PowerShell 4.0 – Checking SCOM Required Ports

If you are going to install SCOM there are requirements which you have to be aware of. Microsoft has a great article on TechNet which describes precisely what the requirement and supported configuration is for your SCOM setup. Depending on the size of your (distributed) SCOM infrastructure, you might have to install several management servers, gateway servers and of course database servers. One of the basic requirement is to have all necessary ports open on the SCOM servers. In a multi server environment it can be time consuming to check all the ports which must be open on each system, especially if you need to troubleshoot your SCOM installation.

PowerShell 4.0 which is part of Windows Server 2012 R2 and Windows 8.1 has a great new cmdlet Test-NetConnection, which can save you a lot of time troubleshooting network connection problems. You can even accelerate your process, if you are using these cmdlets in a PowerShell script. One example, I thought would be very useful, if we build a script which checks all required SCOM ports.

How does it work? Let’s see…

In this sample script I created a hash table, which is basically a list with key / value pairs, containing all required port description and the corresponding port number. Next, I iterate through the hash table and pass the values to the Test-NetConnection cmdlet. Finally the script writes an output depending on the result of the test.

The script looks like this…

image

If you are going to run the script, it first asks you about the computer name for which you would like to check the ports. In PowerShell the output will look like this…

image

As you can see it is very easy to have a script in place which can really save you time. Of course you can adapt the script / idea for other products and requirements.

Be aware that Windows Server 2012 R2  respectively PowerShell 4.0 is required for this script to run successfully, because of the Test-NetConnection cmdlet.

My second intension is, to make you aware of the countless new PowerShell cmdlets in the upcoming Windows Sever 2012 R2 edition. Check the TechNet site to get an overview and explore how it easy it will be to solve common problems easily. This really unleashes the Power(of)Shell…

Download Script

1 Comment

  1. Pingback: PowerShell 4.0 – Checking SCOM Required Ports - SysManBlog

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