Skip to content

Get SQL Server Network Configuration with PowerShell

This blog is part of a set which try to automate the SQL Server administration with PowerShell. It explains how to retrieve the network configuration of a SQL Server instance with PowerShell.

I will refer to my previous blog Get SQL Server services with PowerShell. I presented how to get the SQL Server Engine service. I will assume the service has already been retrieved.

Disclaimer: I am not a developer but a SQL Server dba. If you find errors or some ways of improvement, I will be glad to read your comments!

SQL Engine service

I use the SMO objects to access the SQL Server Engine service. The object obtained has several properties.
This object can retrieve important information concerning the SQL Server Engine service, such as:

service_properties.png

TCP/IP information

This time, we will use the WMI objects issued from the SMO.  To retrieve the corresponding TCP/IP object concerning the specific instance, proceed as follows:

wmi_object_tcp_ip.png

The “Microsoft.SqlServer.Management.Smo.Wmi” namespace contains all the classes that represent the SQL Server WMI.

Now, to display the TCP/IP information of your instance, proceed as follows:

tcp_ip_information.png

Named Pipe information

As for TCP/IP, we build the WMI object for the Named Pipe with:

wmi_object_named_pipe.png

Now to display the Named Pipe information, proceed as follows:

named_pipe_information.png

Shared Memory information

As for the previous ones, we build the WMI object for the Shared Memory with:

wmi_object_shared_memory_20150512-063808_1.png

Now to display the Shared Memory information, proceed as follows:

shared_memory_information.png

Next steps

With these commands, you can generate a dashboard for a specific instance. Here is an example from ourDatabase Management Kit (DMK):

dmk_service_20150512-064356_1.png

I hope this blog will help you in your work 😉

Let’s work together

Ready to operate at
the next level?

Tell us about your challenge. We’ll bring the depth, the expertise, and the Swiss precision.

Nathan Courtine

Nathan Courtine

Nathan Courtine has more than nine years of experience in Microsoft solutions, specializing in SQL Server installation, migration, performance analysis, and automation. He holds Microsoft Certified Solutions Expert (MCSE), Microsoft Certified Azure Administrator Associate, and AWS Certified Solutions Architect Associate credentials. He holds a Computer Science degree from ENSISA Mulhouse. His industry experience covers the public sector, pharma, IT, and banking/financial services.View Author posts

40 posts since December 2013

Most read in Database

The Database posts our readers open most: the all-time favourites, and what is trending right now.

Leave a Comment

Your email address will not be published. Required fields are marked *