Sunday, July 30, 2017

Last System/Computer BootUpTime

Use below code to show up system/server LastBootUptime

Get-CimInstance -ClassName win32_operatingsystem -ComputerName Server01,Server02,Server03 | select csname, lastbootuptime | SORT CSNAME

OR

Get-CimInstance -ClassName win32_operatingsystem -ComputerName (Get-Content D:\serverS.TXT) | select csname, lastbootuptime | SORT CSNAME | ft -AutoSize

OR

gwmi win32_operatingsystem -comp Server01,Server02,Server03 | select PSComputerName, @{n='BootTime';e={$_.ConvertToDateTime($_.LastBootupTime)}}

Output:
 

No comments:

Post a Comment