WSUS, Automatic get rid of Itanium Updates nobody needs in 2013

by butsch 5. July 2013 04:09

WSUS-Admins who take care of their WSUS Server and run the box over a few years know why to sort

Out updates which you don't need. Esp. when you run on SQL Express. Yes you can shrink, yes you can migrate

But it gets slow. So best practive is to decline the "superseded updates" or updates which are quite old.

Also the "Itanium" updates which some guy at a university and bill gates in his garage still use.

 

http://gallery.technet.microsoft.com/scriptcenter/Automatically-Declining-a4fec7be

 

If you run the script without chaning the Signung policy of your 2008R2 or maybe also 2012?

 

Error:

 

File C:\batch\lab_wsus_decline_itaniunm.ps1 cannot be loaded because running

scripts is disabled on this system. For more information, see about_Execution_Policies at

http://go.microsoft.com/fwlink/?LinkID=135170.

At line:1 char:1

+ .\lab_wsus_decline_itaniunm.ps1

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : SecurityError: (:) [], PSSecurityException

    + FullyQualifiedErrorId : UnauthorizedAccess

 

 

To get rid of the "unsigned PS error" > Please read in Technet what this does (Opens security!)

 

 

PS C:\batch> Set-ExecutionPolicy RemoteSigned

PS C:\batch> .\batch\ lab_wsus_decline_itaniunm.ps1

 

(Notice the .\scriptname!)

Change the red parameters to your WSUS-Server, Check in IIS (Internet Information Server) which Port your WSUS uses

 

$WsusServer = "192.168.1.48"

$UseSSL = $false

$PortNumber = 8530

$TrialRun = $true

# $TrialRun = $false (To actually do it)

 

[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null

$WsusServerAdminProxy = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer($WsusServer,$UseSSL,$PortNumber);

 

#$itanium = $WsusServerAdminProxy.SearchUpdates('Itanium') | ?{-not $_.IsDeclined}

#$itanium += $WsusServerAdminProxy.SearchUpdates('ia64') | ?{-not $_.IsDeclined}

#Although the above seems faster it also seaches in the description of the update so use the below just to search the title!

$itanium = $WsusServerAdminProxy.GetUpdates() | ?{-not $_.IsDeclined -and $_.Title -match "ia64|itanium"}

If ($TrialRun)

{$MessageSubject += " Trial Run"}

Else

{$itanium | %{$_.Decline()}}

 

Tags:

Comments are closed

Werbung von Drittfirmen (Nicht Butsch Informatik):

Werbung von Drittfirmen via Google Adsense: