Tag: Server Up Time

  • Powershell Function to Get the Last Boot Up Time of a Computer

    [sourcecode language=”powershell” wraplines=”false”] #Return the last reboot time of a computer #Usage: Get-LastBootUpTime [ServerName] Function Get-LastBootUpTime { param ([string]$computername=$env:computername) $computername = $computername.toupper() Get-WmiObject -ComputerName $computername win32_operatingsystem| select csname, @{LABEL=’LastBootUpTime’;EXPRESSION={$_.ConverttoDateTime($_.lastbootuptime)}} } [/sourcecode]