Get-DbaNetworkConfiguration
View SourceSynopsis
Retrieves SQL Server network protocols, TCP/IP settings, and SSL certificate configuration from SQL Server Configuration Manager
Description
Collects comprehensive network configuration details for SQL Server instances, providing the same information visible in SQL Server Configuration Manager but in a scriptable PowerShell format. This function is essential for network connectivity troubleshooting, security audits, and compliance reporting across multiple SQL Server environments.
The function retrieves protocol status for Shared Memory, Named Pipes, and TCP/IP, along with detailed TCP/IP properties including port configurations, IP address bindings, and dynamic port settings. It also extracts SSL certificate information, encryption settings, and advanced security properties like SPNs and extended protection settings.
Since the function accesses SQL WMI and Windows registry data, it uses PowerShell remoting to execute on the target machine, requiring appropriate permissions on both the local and remote systems.
For a detailed explanation of the different properties see the documentation at:
https://docs.microsoft.com/en-us/sql/tools/configuration-manager/sql-server-network-configuration
Syntax
Get-DbaNetworkConfiguration
[-SqlInstance] <DbaInstanceParameter[]>
[[-Credential] <PSCredential>]
[[-OutputType] <String>]
[-EnableException]
[<CommonParameters>]
Examples
Example: 1
PS C:\> Get-DbaNetworkConfiguration -SqlInstance sqlserver2014a
Returns the network configuration for the default instance on sqlserver2014a.
Example: 2
PS C:\> Get-DbaNetworkConfiguration -SqlInstance winserver\sqlexpress, sql2016 -OutputType ServerProtocols
Returns information about the server protocols for the sqlexpress on winserver and the default instance on sql2016.
Required Parameters
-SqlInstance
The target SQL Server instance or instances.
| Property | Value |
|---|---|
| Alias | |
| Required | True |
| Pipeline | true (ByValue) |
| Default Value |
Optional Parameters
-Credential
Credential object used to connect to the Computer as a different user.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | false |
| Default Value |
-OutputType
Controls which network configuration details are returned from SQL Server Configuration Manager.
Use this to focus on specific troubleshooting areas or reduce output when checking multiple instances.
Valid options: Full, ServerProtocols, TcpIpProperties, TcpIpAddresses, Certificate (defaults to Full).
Full provides complete network configuration including all protocols, TCP/IP settings, IP bindings, and SSL certificate details.
ServerProtocols shows only whether Shared Memory, Named Pipes, and TCP/IP protocols are enabled.
TcpIpProperties returns TCP/IP protocol settings like KeepAlive timeout and whether the instance listens on all IP addresses.
TcpIpAddresses displays port configurations and IP address bindings for connection troubleshooting.
Certificate outputs SSL certificate information and encryption enforcement settings for security audits.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | false |
| Default Value | Full |
| Accepted Values | Full,ServerProtocols,TcpIpProperties,TcpIpAddresses,Certificate |
-EnableException
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with “sea of red” exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this “nice by default” feature off and enables you to catch exceptions with your own try/catch.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | false |
| Default Value | False |
Outputs
PSCustomObject
Default (-OutputType Full) returns a PSCustomObject with the following properties:
- ComputerName: Computer name of the SQL Server instance
- InstanceName: SQL Server instance name
- SqlInstance: Full SQL Server instance name (computer\instance format)
- SharedMemoryEnabled: Boolean indicating if Shared Memory protocol is enabled
- NamedPipesEnabled: Boolean indicating if Named Pipes protocol is enabled
- TcpIpEnabled: Boolean indicating if TCP/IP protocol is enabled
- TcpIpProperties: Nested object containing Enabled, KeepAlive, and ListenAll properties for TCP/IP configuration
- TcpIpAddresses: Array of objects representing IP address configurations with properties like Name, Active, Enabled, IpAddress, TcpDynamicPorts, and TcpPort
- Certificate: Nested object containing SSL certificate information (FriendlyName, DnsNameList, Thumbprint, Generated, Expires, IssuedTo, IssuedBy, Certificate object)
- Advanced: Nested object containing advanced settings (ForceEncryption, HideInstance, AcceptedSPNs, ExtendedProtection)
When -OutputType ServerProtocols is specified:
- ComputerName: Computer name of the SQL Server instance
- InstanceName: SQL Server instance name
- SqlInstance: Full SQL Server instance name (computer\instance format)
- SharedMemoryEnabled: Boolean indicating if Shared Memory protocol is enabled
- NamedPipesEnabled: Boolean indicating if Named Pipes protocol is enabled
- TcpIpEnabled: Boolean indicating if TCP/IP protocol is enabled
When -OutputType TcpIpProperties is specified:
- ComputerName: Computer name of the SQL Server instance
- InstanceName: SQL Server instance name
- SqlInstance: Full SQL Server instance name (computer\instance format)
- Enabled: Value indicating if TCP/IP protocol is enabled
- KeepAlive: TCP KeepAlive timeout setting value
- ListenAll: Value indicating if instance listens on all IP addresses
When -OutputType TcpIpAddresses is specified:
If ListenAll is True, returns one object for IPAll:
- ComputerName: Computer name of the SQL Server instance
- InstanceName: SQL Server instance name
- SqlInstance: Full SQL Server instance name (computer\instance format)
- Name: IP configuration name (IPAll)
- TcpDynamicPorts: Dynamic port configuration (empty or port number)
- TcpPort: Static port number configuration
If ListenAll is False, returns one object per configured IP address:
- ComputerName: Computer name of the SQL Server instance
- InstanceName: SQL Server instance name
- SqlInstance: Full SQL Server instance name (computer\instance format)
- Name: IP configuration name (e.g., IP1, IP2, IPV6)
- Active: Value indicating if this IP configuration is active
- Enabled: Value indicating if this IP configuration is enabled
- IpAddress: The IP address (IPv4 or IPv6)
- TcpDynamicPorts: Dynamic port configuration (empty or port number)
- TcpPort: Static port number configuration
When -OutputType Certificate is specified:
- ComputerName: Computer name of the SQL Server instance
- InstanceName: SQL Server instance name
- SqlInstance: Full SQL Server instance name (computer\instance format)
- VSName: Virtual Server Name (if applicable; omitted if not present)
- ServiceAccount: Service account running SQL Server
- ForceEncryption: Boolean indicating if encryption is forced for all connections
- FriendlyName: Human-readable certificate name
- DnsNameList: Array of DNS names in the certificate’s Subject Alternative Names
- Thumbprint: SHA-1 hash thumbprint of the certificate
- Generated: DateTime when the certificate becomes valid (NotBefore)
- Expires: DateTime when the certificate expires (NotAfter)
- IssuedTo: Certificate subject (who it was issued to)
- IssuedBy: Certificate issuer name
- Certificate: The full X509Certificate2 object with complete certificate information
dbatools