Thor Logo dbatools

Get-DbaClientProtocol

View Source
Klaas Vandenberghe (@PowerDBAKlaas)
Windows, Linux, macOS

Synopsis

Retrieves SQL Server client network protocol configuration and status from local or remote computers.

Description

Retrieves the configuration and status of SQL Server client network protocols (Named Pipes, TCP/IP, Shared Memory, VIA) from local or remote computers. This function helps DBAs audit and troubleshoot client connectivity issues by showing which protocols are enabled, their order of precedence, and associated DLL files.

The returned objects include Enable() and Disable() methods, allowing you to modify protocol settings directly without opening SQL Server Configuration Manager. This is particularly useful for standardizing client configurations across multiple servers or troubleshooting connectivity problems.

Requires Local Admin rights on destination computer(s) and SQL Server 2005 or later.
The client protocols can be enabled and disabled when retrieved via WSMan.

Syntax

Get-DbaClientProtocol
    [[-ComputerName] <DbaInstanceParameter[]>]
    [[-Credential] <PSCredential>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaClientProtocol -ComputerName sqlserver2014a

Gets the SQL Server related client protocols on computer sqlserver2014a.

Example: 2
PS C:\> 'sql1','sql2','sql3' | Get-DbaClientProtocol

Gets the SQL Server related client protocols on computers sql1, sql2 and sql3.

Example: 3
PS C:\> Get-DbaClientProtocol -ComputerName sql1,sql2 | Out-GridView

Gets the SQL Server related client protocols on computers sql1 and sql2, and shows them in a grid view.

Example: 4
PS C:\> (Get-DbaClientProtocol -ComputerName sql2 | Where-Object { $_.DisplayName -eq 'Named Pipes' }).Disable()

Disables the VIA ClientNetworkProtocol on computer sql2.
If successful, return code 0 is shown.

Optional Parameters

-ComputerName

Specifies the target computer(s) to retrieve SQL Server client protocol configuration from. Accepts computer names, IP addresses, or SQL Server instance names.
Use this when you need to audit client protocol settings on remote servers or troubleshoot connectivity issues across multiple machines.
Defaults to the local computer if not specified.

PropertyValue
Aliascn,host,Server
RequiredFalse
Pipelinetrue (ByValue)
Default Value$env:COMPUTERNAME
-Credential

Credential object used to connect to the computer as a different user.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default Value
-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.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default ValueFalse