?
Solved

Powershell & WSUS Updates

Posted on 2014-08-11
2
Medium Priority
?
437 Views
Last Modified: 2016-02-20
can someone help me out here? I'm trying to get WSUS updates via powershell with the command:
$WsusServerAdminProxy.GetUpdates() | ?{-not $_.IsDeclined -and $_.ProductTitles -match "Windows XP” }

That's listing all Updates for Windows XP correctly.. but it lists also the Updates which are for "Windows XP, Windows 2003". But I'd would only decline the updates which are for XP only.

I tried to reach that so: Change -match "Windows XP"  to -eq "Windows XP”, or -like "Windows XP” , but nothing worked.

Circumstances/Usage:
[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null
$WsusServerAdminProxy = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer($WsusServer,$UseSSL,$PortNumber);
$updates = $WsusServerAdminProxy.GetUpdates() | ?{-not $_.IsDeclined -and $_.ProductTitles -like "Windows XP” }
0
Comment
Question by:Lionstone
  • 2
2 Comments
 

Accepted Solution

by:
Lionstone earned 0 total points
ID: 40254938
I found it out myself hand with the help in the irc.freenode.net #Powershell Chat.

?{-not $_.IsDeclined -and $_.ProductTitles -match "Windows XP" -and $_.ProductTitles.Count -lt "2" }
0
 

Author Closing Comment

by:Lionstone
ID: 40254943
luckily the ProductTitles don't count two for XP 32bi and XP 64bit, because this are separate updates. Otherwise it wouldn't work.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had a hard drive that you can't boot into, but need to change the registry? Here is the solution! This article guides you through accessing and editing a registry of a non-primary drive. To read registry information on a non-prim…
Many admins will agree: WSUS is is a nice invention but using it on the client side when updating a newly installed computer is still time consuming as you have to do several reboots and furthermore, the procedure of installing updates, rebooting an…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question