【发布时间】:2021-01-08 23:18:24
【问题描述】:
我正在使用以下脚本远程检索 Windows Defender 状态。
$password = ConvertTo-SecureString “myPassword” -AsPlainText -Force
$credentials = New-Object System.Management.Automation.PSCredential (“myUserNamer”, $password)
$sessionOption = New-CimSessionOption -Protocol WsMan
$session = New-CIMSession -ComputerName myMachineName -Credential $credentials -SessionOption
Get-MpPreference -CimSession $session
但是,我对 PowerShell 脚本和相关协议还很陌生。当我可能需要在数百台计算机上运行这些信息时,这是检索此信息的最佳方式吗?
【问题讨论】:
标签: windows powershell powershell-remoting windows-defender