PowerShell 尋找刪除Windows補丁檔案

來源:互聯網
上載者:User

標籤:wsus   補丁   powershell   刪除   

今天早上收到了總公司的一個郵件通告,大意是最新的3月份的Windows補丁檔案kb4088875會造成Vmware下的Windows 7和 Windows 2008 R2失去IP地址,望大家注意。

豆子一般用WSUS伺服器打補丁,而且頻率比較積極。上WSUS一看呢,這個安全補丁已經預設 Approve了,趕快 decline掉。

因為這個補丁已經出來有2周了,估計有些伺服器已經打上補丁了,這些已經安裝了的補丁不會自動刪除掉。儘管我在wsus上禁止安裝了,這個設定只會對沒有安裝的伺服器起作用,對於已經安裝了的需要手動刪除。

用Powershell搜尋一下,看看哪些機器已經安裝了。

$a=Get-ADComputer -Filter {operatingsystem -like "*2008 R2*"} | select name$b=invoke-command -ComputerName $a.name -script {Get-Hotfix | where {$_.HotFixId -like "KB4088875"}} -ErrorAction SilentlyContinue

結果如下,還好就幾台

刪除補丁也很容易,執行下面的遠程命令

invoke-command -ComputerName $b.pscomputername -script {Start-Process wusa.exe -ArgumentList ‘/KB:4088875 /uninstall /quiet /norestart‘ -Wait }

重新掃描一次 okay 成功刪除

PowerShell 尋找刪除Windows補丁檔案

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.