Get-Content C:\scripts\serverslist.txt |
{ Invoke-WmiMethod -ComputerName $_ -Namespace root\ccm\clientsdk -Class CCM_ClientUtilities -Name DetermineIfRebootPending |
select PSComputerName,RebootPending } |
Export-Csv -NoTypeInformation C:\scripts\PendingReboots.csv