Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Find computer which has not been updated for 30 days or more

$
0
0

Hi,

Im quite new to Powershell and im trying to figure out how to create a script which looks at computers within a OU and then try to find computers which has not been updated for 30 Days or more.

There are a few scripts and one-lines that provides information about when the latest patch was installed on a computer, but I wish to know if no updates has been installed for 30 Days or more.

Its a great function to know if theres update problem with the server enviroment.

The best would be if the script could red-mark the server which have not been updated, and the updated servers is green-marked. I would like to invoke this script remote, from a management server etc.

All I've found so far is a one-liner that gives me the latest "Installedon" and I can change the day variable. Not really what Im looking for, but Close.

I want to invoke the command via the win32_quickfixengineering since I've seen that Its the most reliable soruce to find updates on the targeted computer.

gwmiWin32_QuickFixEngineering|? {$_.InstalledOn} |where { (Get-date($_.Installedon)) -gt(get-date).adddays(-30) } |Format-Table-Property*-AutoSize

Any help is appreciated

Thank you,

Emil


Viewing all articles
Browse latest Browse all 6937

Trending Articles