当我尝试使用以下代码行从远程计算机运行 wuauclt /resetauthorization /detectnow 时,客户端检测到 0 个更新(在日志文件中写入条目)。
$username = "uname"
$password = ConvertTo-SecureString "pass" -AsPlainText -Force
$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
Invoke-command -Computer ComputerName -Credential $cred -Script {wuauclt /resetauthorization /detectnow}
但是,一旦我在同一系统上手动运行它,它就会检测到更新。什么会导致此命令在远程调用时无法检测到更新?