Get-CimInstance -ClassName win32_operatingsystem | select csname, lastbootuptime
Mostly work related stuff which I would've entered into my "Log book". Instead of hosting it on an intranet site, outsourcing the hosting to blogger!
Saturday, July 23, 2022
uptime equivalent on Windows
To find out how long a Windows machine has been on, the equivalent of uptime on Linux - https://devblogs.microsoft.com/scripting/powertip-get-the-last-boot-time-with-powershell/
Using this in a "Basic Task" with Task Scheduler did not work when not logged on. So, instead of creating a basic task, used "create task" and chose "run whether user is logged in or not." Also enabled run with highest privileges.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment