Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-09-19
9
Medium Priority
?
520 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 29

Accepted Solution

by:
Michael Pfister earned 2000 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

A procedure for exporting installed hotfix details of remote computers using powershell
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

704 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