【发布时间】:2017-12-07 05:23:14
【问题描述】:
代码示例:
$UpdateSession = New-Object -ComObject 'Microsoft.Update.Session'
$UpdateSearcher = $UpdateSession.CreateUpdateSearcher()
$Updates = $UpdateSearcher.Search('IsInstalled=1')
$Updates | Where-Object { $_.Title -like '*KB2506143*' }
我正在尝试以编程方式卸载 WMF3,但在尝试使用 wusa.exe 时不断出错,
wusa /uninstall /kb:2506143 /quiet /norestart /log:C:\log.evt
CbsClient::CbsClient.00110: 创建 CBS 会话实例失败
CbsClient::CbsClient.00127:退出,错误代码为 0X80040154(类未注册)
UninstallWorker.00664:搜索开始
CbsClient::OpenPackageByKB.00268: CBS 会话未初始化。
CbsClient::OpenPackageByKB.00320:退出,错误代码为 0X8000ffff(灾难性故障)
UninstallWorker.00667:失败:针对 KB2506143 的 OpenPackageByKB()
UninstallWorker.00799:退出并显示错误代码 0X8000ffff(灾难性故障)
RebootIfRequested.01446:未安排重启。 IsRunWizardStarted:0,IsRebootRequired:0,RestartMode:1
由于错误 2147549183“灾难性故障”(命令行:“C:\windows\System32\wusa.exe /uninstall /kb:2506143 /quiet /norestart /log:C:\log.evt”),无法卸载 Windows 更新
wWinMain.01962: 卸载更新失败;错误:0X8000ffff,灾难性故障。命令行:C:\windows\System32\wusa.exe /uninstall /kb:2506143 /quiet /norestart /log:C:\log.evt
wWinMain.01998:退出并返回错误代码 0X8000ffff(灾难性故障)
所以我正在使用 WUA API。上面的代码 sn-p 给了我一个$Null 返回,但我可以使用Get-Hotfix -ID KB2506143 或Get-WmiObject -Class Win32_QuickFixEngineering -Filter 'HotFixID="KB2506143"' 来查找更新。
This question 类似,但在找到补丁后尝试卸载补丁时访问被拒绝,而我的问题是:我首先如何找到补丁?
我不确定补丁是如何应用的,所以如果我找到它后遇到同样的问题,我至少有that resolution。
【问题讨论】:
标签: windows powershell windows-server-2008 patch wuapi