Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

Help with getting date of last Windows Update from a list of several computers?

$
0
0

I have a txt file with a list of a jillion or so computers. What I'm trying to do is simply get the date of the last time Windows Update was run on each machine, so 1 line per machine.

I started out with this, which of course didn't work:

$computers=Get-Content-path allDesktops.txt

Get-hotfix-ComputerName$computers|sortinstalledon-desc|selectinstalledon-first1

Instead of getting 1 entry per computername, I'm only getting 1 entry altogether. How can I limit it so I get the last installedon date for each machine?

Thanks! Powershell is great, I'm way behind the curve just now trying to get into it :)

-Mike


Viewing all articles
Browse latest Browse all 10624