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

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
crp0499CEOAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Michael PfisterConnect With a Mentor Commented:
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
 
SubsunCommented:
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
 
Donald StewartNetwork AdministratorCommented:
So, you have never ran WSUS cleanup (Which deletes declined updates) ??
And just out of curiosity, why the need for this list ??
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
crp0499CEOAuthor Commented:
I'll try some of these later today.
0
 
crp0499CEOAuthor Commented:
That answer works perfectly.
0
 
crp0499CEOAuthor Commented:
I'll award points versus having the question forced to closure.
0
 
SubsunCommented:
@crp0499, The command which I suggested with Sort-Object didn't work??
0
All Courses

From novice to tech pro — start learning today.