PowerShell – Server Quick Check v1

April 11, 2013

Following on from my initial PowerShell post I decided to expand on that script.

The idea behind this PowerShell script was to obtain and display Windows Server information instantly. I was thinking along the lines of someone walking up to your cubicle and throwing any of the following questions at you:

  • How much disk space do we have on server xxx?
  • When was server xxx last rebooted?
  • Who are the local administrators on server xxx?
  • What shares exist on server xxx?
  • Etc

How quickly could you obtain these answers? How many different tools and utilities would you start firing up?  Would this result in a whirlwind of whirlwind of CTRL + TAB between various applications? The answers to the above questions (and more) could be obtained by using any of the following tools and utilities e.g. 

  • Windows Explorer
  • The Computer Management console
  • VMWare console
  • Event Viewer
  • SCOM
  • SSMS
  • Remote connecting to the server

More than likely you probably have many other scripts, tools or utilities that gather this information daily.  However, what I’m really trying to achieve is to answer all those questions in the minimum amount of key strokes and time. How about 4 keyboard strokes!! Yes, 4!

  1. Keyboard Windows Key (1 key stroke)
  2. Type ‘qc’ (2 key strokes) in the run/search box
  3. Press {enter}  (1 key stroke)

Now that’s fancy! Someone high up and important stands behind you and watches an old school DOS window popup, and all the server information stream out in the same time that it takes them to pull up and chair.

Shorterned example of the output:

PowerShell Quick Server Check

How to install

  1. Download these two files: (quickcheckBATcode) and (quickcheckPScode)
  2. Save the contents of [quickcheckBATfile.docx] into a [qc.bat] file within [c:\windows\system32] folder.
  3. Save the contents of [quickcheckPScode.docx] into a [QuickCheck.ps1] file within [c:\windows\system32] folder.

Note: It’s not best practice to save into this system folder, but we doing this to achieve the minimum number of key strokes as mentioned above. I’m also supplying word files as wordpress has restrictions on what file types can be uploaded. The bat file simply calls the PowerShell (ps1) file.

How to execute

  1. Keyboard Windows Key or click on the Windows Start Icon
  2. Type ‘qc’ in the run/search box and press {enter}
  3. Type in your servername at the prompt

QuickCheck v1 currently returns the following information:

  • Operating System
  • Server Specification
  • Current Disk Space
  • Last Reboot time
  • Network Shares
  • Services (running under a service account)
  • Services (set to automatic, but stopped)

Thanks for reading.

 

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: