Skip to content

Instantly share code, notes, and snippets.

@yradunchev
Created November 16, 2017 09:06
Show Gist options
  • Select an option

  • Save yradunchev/b217b85f5e237e3705fa94e95ad81156 to your computer and use it in GitHub Desktop.

Select an option

Save yradunchev/b217b85f5e237e3705fa94e95ad81156 to your computer and use it in GitHub Desktop.
Check servers for reboots pending
Get-Content C:\scripts\serverslist.txt |
% { Invoke-WmiMethod -ComputerName $_ -Namespace root\ccm\clientsdk -Class CCM_ClientUtilities -Name DetermineIfRebootPending |
select PSComputerName,RebootPending,RebootDeadline } |
Export-Csv -NoTypeInformation C:\scripts\PendingReboots.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment