Computer last boot Up time

Using this code you can quickly determine the last time a computer was booted (started)

#Powershell 3.0
Get-CimInstance -ClassName win32_operatingsystem | select csname, lastbootuptime

#Powershell 2.0
Get-WmiObject win32_operatingsystem | select csname, @{LABEL=’LastBootUpTime’;EXPRESSION={$_.ConverttoDateTime($_.lastbootuptime)}}

There. Now you should be able to put this one liner into invoke-command and get the same information across multiple computers.


Leave a comment

Your email address will not be published. Required fields are marked *