Mr. Roboto

Can You See Me Now?

Sometimes, all you want is a quick reassurance that your server farm is OK. Here's a script to give you some peace of mind.

If you're responsible for maintaining a larger server farm, you've probably invested in some sort of monitoring solution. You want to know at the earliest opportunity if a server goes down or starts misbehaving. Even admins in small to midsize shops might like a tool that offers this peace of mind. This month, Mr. Roboto has a very simple PowerShell script called Display-ComputerStatus.ps1, which you can download from the script library at

In order to run this script, you'll need PowerShell 1.0 installed on your computer -- or wherever you want to run it -- and access to the Windows Management Instrumentation (WMI) service on any remote machine you want to monitor. You'll also need a text list of computer names that you want to monitor, with one computer name per line. If you have scripting experience, you could modify the script to pull names from Active Directory, but I wanted to keep this simple. Download the script and rename it with a .PS1 file extension. Run it from your PowerShell console:

PS C:\Scripts > .\Display-Comput

The first thing you'll notice is the script creates a graphical display. PowerShell doesn't have to be console-based alone. I created this form using PrimalForms, the free forms-builder tool from Sapien, downloadable from the Free Tools section of I've also included the source file if you want to edit it yourself. To use the form, enter the path and file name of your text file and click the Get Status button.

How It Works
First the script pings each computer. If the computer can be pinged, a WMI query is executed against the computer to query the Win32_OperatingSystem class. From this class, the form will display the operating system name, Service Pack and when the computer was last booted. From the last boot time, a total uptime value is calculated and displayed. The script has no provision for alternate credentials, so you need to run it with an account that has administrator rights on all the computers in your list.

Results will be displayed in green text. If the initial ping fails, the results will be displayed in red text. The default display is sorted on the computer name. Clicking column headings won't change the sort, but you can drag and drop to reorder columns. You can also resize the form to stretch out column headings or to hide empty datagrid space.

By default, the script will check all the computers again in five minutes. You can change the interval in five-minute increments up to 60 minutes. One point to remember is that any changes to the interval value won't take effect until the next refresh cycle -- though you can change the value and click Get Status to start a new refresh cycle.

I also added a feature that I hope you'll find useful. Double-click on any computer name in the grid and the computer-management console will launch, connecting to the remote computer. Not only can you see the status of critical servers at a glance, you can also easily manage them.

Scripting in Action
If you open the script file in a scripting editor, such as PrimalScript 2009, you'll notice many Write-Debug commands. These lines display information about what the script is doing, what value a particular variable might have and other useful information. I can turn these lines "on" by setting the $DebugPreference variable to Continue. My script takes a parameter, -debug, that if specified will turn on the debug pipeline and display this debug message:

PS C:\Scripts > .\Display-Comput
erStatus.ps1 -debug

The script has error handling, and will write warning messages for computers to which it can't connect. If you prefer not to see these warnings, use the -NoWarning parameter when running the script:

PS C:\Scripts > .\Display-Comput
erStatus.ps1 -nowarning

This script won't replace a full-featured network-monitoring solution, but it may be just what you need for a quick status and sanity check.

If you have any questions about this script or using PowerShell, please stop by the forums at

About the Author

Jeffery Hicks is an IT veteran with over 25 years of experience, much of it spent as an IT infrastructure consultant specializing in Microsoft server technologies with an emphasis in automation and efficiency. He is a multi-year recipient of the Microsoft MVP Award in Windows PowerShell. He works today as an independent author, trainer and consultant. Jeff has written for numerous online sites and print publications, is a contributing editor at, and a frequent speaker at technology conferences and user groups.


  • Microsoft Hires Movial To Build Android OS for Microsoft Devices

    Microsoft has hired the Romanian operations of software engineering and design services company Movial to develop an Android-based operating system solution for the Microsoft Devices business segment.

  • Microsoft Ending Workflows for SharePoint 2010 Online Next Month

    Microsoft on Monday gave notice that it will be ending support this year for the "workflows" component of SharePoint 2010 Online, as well as deprecating that component for SharePoint 2013 Online.

  • Why Windows Phone Is Dead, But Not Completely Gone

    Don't call it a comeback (because that's not likely). But as Brien explains, there are three ways that today's smartphone market leaves the door open for Microsoft to bring Windows back to smartphones.

  • Feature Update Deferral Mix-Up in Windows 10 Version 2004 Further Explained

    Microsoft last week described the confusion it is attempting to avoid by removing the client graphical user interface (GUI)-based controls to defer Windows 10 feature updates, starting with version 2004.

comments powered by Disqus

Office 365 Watch

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.