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 😉