We all have our own ways of finding a servers / computers uptime.
But I thought I’d share my favorite way:
$operatingSystem = Get-WmiObject Win32_OperatingSystem
Some times you need to scheduler a restart of services on servers or computers, and I used to do this via a batch job, that I called from Task Scheduler, but..
I found a much easier way of doing this, just create a new task, and add the Actions like bellow.
NET as the program, and START/STOP “SERVICENAME” as the argument
and voila, there it is 🙂