I have a list of ad-integrated computers and I need a list of them with their last reboot time. I found some comands like Get-WmiObject -ClassName win32_operatingsystem -ComputerName xxx | select csname, lastbootuptime but it's not what I need. I would need a script because there are lots of computers.
I have no experience with PowerShell, if someone could help me with some suggestions.
PS C:\Users\XxX> Get-wmiobject win32_operatingsystem -ComputerName LC006909 | select csname, @{label='LastRestart';expression={$_.ConverToDateTime($_.LastBootUpTime)}} csname LastRestart ------ ----------- LC006909 I get this output ... empty under LastRestart.
20150916141135.109999+330, then it's easily parsable into a "normal time output". Just break out the characters into year (2015), month (09), day (16), hour (14), minutes (11), seconds (35), what I assume are milliseconds (109999) and GMT offset (+330).