How to use Windows Powershell to get registry values from multiple hosts

 

We wanted to check all our windows servers were set  to –  ‘Never check for update’ ( windows update and we wanted to check all the hosts without logging to each one of them and the following PS command helped (if the value returned !=1 then it meant thats windows updates was enabled)

 

PS C:\Users\jjoy>  Invoke-Command -ComputerName ear-as-02,bar-as-02,bar-as-01,sab-as-01,sab-as-02 -ScriptBlock { Get-ItemProperty -Path hklm:software\microsoft\windows\currentversion\WindowsUpdate\Auto* -Name “AUOptions” }  

 

 

Leave a comment