Skip to content

Get‑SqlDscServerProtocolTcpIp

dscbot edited this page Dec 28, 2025 · 1 revision

SYNOPSIS

Returns TCP/IP address group information for a SQL Server instance.

SYNTAX

ByServerName (Default)

Get-SqlDscServerProtocolTcpIp [-ServerName <String>] -InstanceName <String> [-IpAddressGroup <String>]
 [<CommonParameters>]

ByServerProtocolObject

Get-SqlDscServerProtocolTcpIp [-IpAddressGroup <String>] -ServerProtocolObject <ServerProtocol>
 [<CommonParameters>]

DESCRIPTION

Returns TCP/IP address group information for a SQL Server instance using SMO (SQL Server Management Objects). The command returns the IP address groups configured for the TCP/IP protocol, including their port configuration.

Each returned object contains an IPAddressProperties collection with properties such as 'TcpPort', 'TcpDynamicPorts', 'Enabled', and 'Active'.

EXAMPLES

EXAMPLE 1

Get-SqlDscServerProtocolTcpIp -InstanceName 'MSSQLSERVER'

Returns all TCP/IP address groups for the default SQL Server instance on the local computer.

EXAMPLE 2

Get-SqlDscServerProtocolTcpIp -InstanceName 'MSSQLSERVER' -IpAddressGroup 'IPAll'

Returns the IPAll address group for the default SQL Server instance on the local computer.

EXAMPLE 3

$ipAllGroup = Get-SqlDscServerProtocolTcpIp -InstanceName 'DSCSQLTEST' -IpAddressGroup 'IPAll'
$tcpPort = $ipAllGroup.IPAddressProperties['TcpPort'].Value

Returns the static TCP port configured for the IPAll address group.

EXAMPLE 4

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

Uses pipeline input from Get-SqlDscServerProtocol to retrieve all TCP/IP address groups.

EXAMPLE 5

Get-SqlDscServerProtocol -InstanceName 'MSSQLSERVER' -ProtocolName 'TcpIp' | Get-SqlDscServerProtocolTcpIp -IpAddressGroup 'IPAll'

Uses pipeline input from Get-SqlDscServerProtocol to retrieve the IPAll address group.

PARAMETERS

-InstanceName

Specifies the name of the SQL Server instance for which to return TCP/IP address group information.

Type: String
Parameter Sets: ByServerName
Aliases:

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

-IpAddressGroup

Specifies the name of the IP address group to return. Valid values include 'IPAll', 'IP1', 'IP2', etc. If not specified, all IP address groups 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

-ServerProtocolObject

Specifies a server protocol object from which to retrieve IP address information. This parameter accepts pipeline input from Get-SqlDscServerProtocol. The protocol object must be the TCP/IP protocol.

Type: ServerProtocol
Parameter Sets: ByServerProtocolObject
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
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.ServerProtocol

A server protocol object can be piped to this command. The protocol

object must be the TCP/IP protocol.

OUTPUTS

Microsoft.SqlServer.Management.Smo.Wmi.ServerIPAddress

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

NOTES

The returned ServerIPAddress object's IPAddressProperties collection contains:

  • TcpPort: The static TCP port number(s) as a comma-separated string
  • TcpDynamicPorts: The dynamic port number (only for IPAll group)
  • Enabled: Whether the IP address group is enabled
  • Active: Whether the IP address is active

RELATED LINKS

Home

Commands

How-to

Resources

Usage

Clone this wiki locally