摘要: 查询被锁定用户 Search-ADAccount -LockedOut | FT Name,ObjectClass -A Search-ADAccount Search-ADAccount Gets Active Directory user, computer, or service accoun
阅读全文
摘要: 安装MSI包使用PowerShell调用WMI对象,你可以执行下面的脚本来安装你的MSI安装包:1 $box="deviis01" #this is the name of your server2 $product= [WMICLASS]"\\$box\ROOT\CIMV2:win32_Produ...
阅读全文
摘要: PSBASEthe raw view of the objectPSADAPTEDthe fully adapted view of the objectPSEXTENDEDjustthe extended elements of the objectPSOBJECTa view of the ad...
阅读全文
摘要: ###################################################################################### THIS IS SAMPLE CODE AND IS ENTIRELY UNSUPPORTED. THIS CODE AND ...
阅读全文
摘要: Add-VMNetworkAdapterAclCreates an ACL to apply to the traffic through a virtual machine network adapter.注:只能在Hyper-V主机上添加ACL,无法在VMM服务器上全局添加Example 1Th...
阅读全文
摘要: 1. OverviewSome time ago, I was automating a few tasks with PowerShell and needed to set NTFS permissions on a folder. I was tempted to use the good o...
阅读全文
摘要: 1.安装SMB带宽限制功能 Add-WindowsFeature FS-SMBBW2.通过PowerShell命令限制SMB带宽#限制非Hyper-V over SMB or Live Migration使用带宽为10MBSet-SmbBandwidthLimit -Category Default...
阅读全文
摘要: 标准数字格式字符串: C or c 货币 "{0:C}" -f 1.23 结果:¥1.23 或 $1.23 D or d 十进制 "{0:d3}" -f 2 结果:002 (在前面补0,补足3位) E or e 科学计数法 "{0:E3}" -f [Math]::Pi 结果:3.142E+000 F
阅读全文
摘要: Windows PowerShell Web Access(PSWA)是 Windows Server 2012 中的新功能,充当 Windows PowerShell 网关,允许远程计算机基于 Web 方式(HTTPS)访问和操作目标计算机的 Windows PowerShell,以执行 Po...
阅读全文
摘要: #配置Remote Desktop Services服务为 自启动,并运行Configuration Myservice{ # A Configuration block can have zero or more Node blocks Node "localhost" { ...
阅读全文
摘要: ###################功能说明########################该脚本用来对离线VHD文件更新,导入系统补丁#########################################################################################################实现过程######################################################1.使用Mount-VHD命令挂载VHD文件,该命令包含在Windows Server 2012中,挂载后的盘符无法确定,需要手工指定,
阅读全文
摘要: 将以下内容保存为.psm1,然后在PowerShell中使用 Import-Module 命令导入.psm1文件后,即可使用其命令1.获取本地用户#--------------------------------------------------------------------------------- #The sample scripts are not supported under any Microsoft standard support #program or service. The sample scripts are provided AS IS without wa
阅读全文
摘要: get-operationsmanagercommand#定义RMS服务器名称(SCOM管理控制台所在服务器名称)#Connect to the RMS server and initialize the command shell$rmsServerName=”scomw.testj.com”#向当前会话添加scom管理单元add-pssnapin “Microsoft.EnterpriseManagement.OperationsManager.Client”#将当前工作会话设置为SCOMSet-Location “OperationsManagerMonitoring::”#测试管理组连
阅读全文