一次批准一个计算机组的WSUS更新 [英] Approving WSUS updates for one computer group at a time
问题描述
我们有一个WSUS服务器和四个计算机组(Alpha,Beta,Production,Workstations)。我们的修补程序让我们批准所有"未批准"的Alpha组发布后,立即被微软发布。一周之后,我们批准Beta组的前一周所有
的更新。一周后,我们对生产做同样的事情。
我正在编写一个脚本(直到下一个我才能测试一周),并想知道是否有更好的方法来获得批准Alpha的更新列表。以下是代码:
$ updateScope = New-Object Microsoft.UpdateServices.Administration.UpdateScope
$ updateScope.ApprovedStates = [ Microsoft.UpdateServices.Administration.ApprovedStates] :: LatestRevisionApproved
$ updateScope.FromArrivalDAte =(Get-Date).AddMonths(-1)
$ wsusGroup = $ wsus.GetComputerTargetGroups()|其中{$ _。Name -eq" $ PatchingGroup"}
$ updateScope
$ updateScope.getType()
$ updateScope.count
$ updateScope.ApprovedComputerTargetGroups.add($ wsusGroup)
$ wsus.GetUpdates($ updateScope)
$更新= $ wsus.GetUpdates($ updateScope)
我假设我可以使用$ Updates变量并为Beta和Production组执行以下操作:
Foreach($ update in $ updates ){
$ update.Approve("Install",$ PatchingGroup)
}
这是否有效,是否有更好的方法?
对于WSUS脚本,请看:http://poshwsus.codeplex.com/
We have a WSUS server, and four computer groups (Alpha, Beta, Production, Workstations). Our patching process has us approve all "Not Approved" patches for the Alpha group, right after they're released by Microsoft. One week later, we approve all of the updates from the previous week, for the Beta group. One week later, we do the same for Production.
I'm writing a script (which I can't test until next week), and wonder if there's a better way to get the list of updates that are approved for Alpha. Here is the code:
$updateScope = New-Object Microsoft.UpdateServices.Administration.UpdateScope $updateScope.ApprovedStates = [Microsoft.UpdateServices.Administration.ApprovedStates]::LatestRevisionApproved $updateScope.FromArrivalDAte = (Get-Date).AddMonths(-1) $wsusGroup = $wsus.GetComputerTargetGroups() | Where {$_.Name -eq "$PatchingGroup"} $updateScope $updateScope.getType() $updateScope.count $updateScope.ApprovedComputerTargetGroups.add($wsusGroup) $wsus.GetUpdates($updateScope) $Updates = $wsus.GetUpdates($updateScope)
I assume I can take the $Updates variable and do the following for the Beta and Production groups:
Foreach ($update in $updates) { $update.Approve("Install",$PatchingGroup) }
Is this going to work, and is there a better way?
For WSUS Scripts see this: http://poshwsus.codeplex.com/
这篇关于一次批准一个计算机组的WSUS更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!