我试图在Windows 2008 r2上使用带有Powershell v4的Microsoft.Update.AutoUpdate COM对象配置Windows更新。然而,我遇到了一些麻烦。在尝试设置NotificationLevel时,我收到以下错误(请注意使用提升的权限运行)。
$WUSettings = (New-Object -com "Microsoft.Update.AutoUpdate").Settings
$WUSettings.NotificationLevel=4
$WUSettings.save()
输出:
异常设置" NotificationLevel":"来自HRESULT的异常: 0x80240037"在行:1个字符:1 + $ WUSettings.NotificationLevel = 4 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:NotSpecified:(:) [],SetValueInvocationException + FullyQualifiedErrorId:CatchFromBaseAdapterSetValueTI
任何帮助都非常感谢!