Get Server Up Time in a smart way (WMI)

This function will take a server name or array of server names, and return Server Up Time in form of TimeSpan data type.

Why this is different ?

What makes this script different than other scripts is two things:

– Faster : Instead of getting all WMI data from Win_OperatingSystem name space, we will only get the server up time property, so less data transfer the wire

– Returns object with two properties : ComputerName, and UpTime.

– Better error handling : Even if there is trouble getting WMI data from the remote computer, the uptime property will be replaced with “n/a” instead of throwing exception.

– Returns TimeSpan : So the UpTime property will be TimeSpan, so you can browse its properties and get uptime in days, minutes, seconds, or even more accurate information.

– Flexible Input Data: Can take input from the pipeline in form of single server or array of server names.

Download the script

You can download the script from here  Get-CorpUpTime


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s