Solved

WSUS, list of declined updates, sorted by date, using powershell

Posted on 2016-09-19
9
146 Views
Last Modified: 2016-10-04
Believe it or not, I've been asked to provide a list of declined updates in WSUS.  That list is HUGE.  I also need it printed.

So, I found a powershell

get-wsusupdate -approval declined

and that produced my list on the screen, so I have part of it.  Now I need it limited by date and then piped to a text file.

Can someone help?

Thanks

Cliff
0
Comment
Question by:crp0499
9 Comments
 
LVL 28

Accepted Solution

by:
Michael Pfister earned 500 total points
ID: 41806066
I'd pipe the output to Export-CSV. You can then Import it to Excel, filter/sort it to your needs and print it formatted nicely .

i.e.

get-wsusupdate -approval declined | Export-CSV C:\Temp\WSUSDeclined.csv -NoTypeInformation 

Open in new window


https://technet.microsoft.com/en-us/library/hh849932.aspx
0
 
LVL 40

Expert Comment

by:Subsun
ID: 41806646
You can use sort to sort the dates using Sort-Object, for example, if you want to sort the CreationDate in dissenting order.
Get-wsusupdate -approval declined | Sort-Object CreationDate -Descending

Open in new window

You can also filter using Where-Object, following example gives last 3 months data..
Get-wsusupdate -approval declined | Where{$_.CreationDate -gt ((Get-Date).AddMonths(-3))} | Sort-Object CreationDate -Descending

Open in new window

result can be exported using Export-CSV
0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 41806806
So, you have never ran WSUS cleanup (Which deletes declined updates) ??
And just out of curiosity, why the need for this list ??
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

Author Comment

by:crp0499
ID: 41806889
I'll try some of these later today.
0
 

Author Comment

by:crp0499
ID: 41828366
That answer works perfectly.
0
 

Author Comment

by:crp0499
ID: 41828368
I'll award points versus having the question forced to closure.
0
 
LVL 40

Expert Comment

by:Subsun
ID: 41828825
@crp0499, The command which I suggested with Sort-Object didn't work??
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

A brief introduction to what I consider to be the best editor for PowerShell.
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 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