Get‑SqlDscServerProtocol - dsccommunity/SqlServerDsc GitHub Wiki

SYNOPSIS

Returns server protocol information for a SQL Server instance.

SYNTAX

ByServerName (Default)

Get-SqlDscServerProtocol [-ServerName <String>] -InstanceName <String> [-ProtocolName <String>]
 [<CommonParameters>]

ByManagedComputerObject

Get-SqlDscServerProtocol -InstanceName <String> [-ProtocolName <String>]
 -ManagedComputerObject <ManagedComputer> [<CommonParameters>]

ByManagedComputerInstanceObject

Get-SqlDscServerProtocol [-ProtocolName <String>] -ManagedComputerInstanceObject <ServerInstance>
 [<CommonParameters>]

DESCRIPTION

Returns server protocol information for a SQL Server instance using SMO (SQL Server Management Objects). The command supports getting information for TcpIp, NamedPipes, and SharedMemory protocols. If no protocol is specified, all protocols are returned.

EXAMPLES

EXAMPLE 1

Get-SqlDscServerProtocol -InstanceName 'MSSQLSERVER' -ProtocolName 'TcpIp'

Returns TcpIp protocol information for the default SQL Server instance on the local computer.

EXAMPLE 2

Get-SqlDscServerProtocol -ServerName 'MyServer' -InstanceName 'MyInstance' -ProtocolName 'NamedPipes'

Returns NamedPipes protocol information for the MyInstance SQL Server instance on the MyServer computer.

EXAMPLE 3

Get-SqlDscServerProtocol -InstanceName 'MSSQLSERVER'

Returns all protocol information for the default SQL Server instance on the local computer.

EXAMPLE 4

Get-SqlDscManagedComputer -ServerName 'MyServer' | Get-SqlDscServerProtocol -InstanceName 'MyInstance'

Uses pipeline input from Get-SqlDscManagedComputer to retrieve all protocols for the specified instance.

EXAMPLE 5

Get-SqlDscManagedComputerInstance -InstanceName 'MyInstance' | Get-SqlDscServerProtocol -ProtocolName 'TcpIp'

Uses pipeline input from Get-SqlDscManagedComputerInstance to retrieve TcpIp protocol information.

PARAMETERS

-InstanceName

Specifies the name of the SQL Server instance for which to return protocol information.

Type: String
Parameter Sets: ByServerName, ByManagedComputerObject
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ManagedComputerInstanceObject

Specifies a managed computer instance object from which to retrieve server protocol information. This parameter accepts pipeline input from Get-SqlDscManagedComputerInstance.

Type: ServerInstance
Parameter Sets: ByManagedComputerInstanceObject
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ManagedComputerObject

Specifies a managed computer object from which to retrieve server protocol information. This parameter accepts pipeline input from Get-SqlDscManagedComputer.

Type: ManagedComputer
Parameter Sets: ByManagedComputerObject
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ProtocolName

Specifies the name of the network protocol to return information for. Valid values are 'TcpIp', 'NamedPipes', and 'SharedMemory'. If not specified, all protocols are returned.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ServerName

Specifies the name of the server where the SQL Server instance is running. Defaults to the local computer name.

Type: String
Parameter Sets: ByServerName
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer

A managed computer object can be piped to this command.

Microsoft.SqlServer.Management.Smo.Wmi.ServerInstance

A server instance object can be piped to this command.

OUTPUTS

Microsoft.SqlServer.Management.Smo.Wmi.ServerProtocol

Returns server protocol objects from SMO (SQL Server Management Objects).

NOTES

RELATED LINKS

⚠️ **GitHub.com Fallback** ⚠️