Solved

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

Posted on 2016-09-19
9
115 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
A procedure for exporting installed hotfix details of remote computers using powershell
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
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…

777 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