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:


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:


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:


Named Pipe information

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


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


Shared Memory information

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


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


Next steps

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


I hope this blog will help you in your work 😉