Get‑SqlDscServerProtocolTcpIp - dsccommunity/SqlServerDsc GitHub Wiki
Returns TCP/IP address group information for a SQL Server instance.
Get-SqlDscServerProtocolTcpIp [-ServerName <String>] -InstanceName <String> [-IpAddressGroup <String>]
[<CommonParameters>]
Get-SqlDscServerProtocolTcpIp [-IpAddressGroup <String>] -ServerProtocolObject <ServerProtocol>
[<CommonParameters>]
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'.
Get-SqlDscServerProtocolTcpIp -InstanceName 'MSSQLSERVER'
Returns all TCP/IP address groups for the default SQL Server instance on the local computer.
Get-SqlDscServerProtocolTcpIp -InstanceName 'MSSQLSERVER' -IpAddressGroup 'IPAll'
Returns the IPAll address group for the default SQL Server instance on the local computer.
$ipAllGroup = Get-SqlDscServerProtocolTcpIp -InstanceName 'DSCSQLTEST' -IpAddressGroup 'IPAll'
$tcpPort = $ipAllGroup.IPAddressProperties['TcpPort'].Value
Returns the static TCP port configured for the IPAll address group.
Get-SqlDscServerProtocol -InstanceName 'MSSQLSERVER' -ProtocolName 'TcpIp' | Get-SqlDscServerProtocolTcpIp
Uses pipeline input from Get-SqlDscServerProtocol to retrieve all TCP/IP address groups.
Get-SqlDscServerProtocol -InstanceName 'MSSQLSERVER' -ProtocolName 'TcpIp' | Get-SqlDscServerProtocolTcpIp -IpAddressGroup 'IPAll'
Uses pipeline input from Get-SqlDscServerProtocol to retrieve the IPAll address group.
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: FalseSpecifies 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: FalseSpecifies 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: FalseSpecifies 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: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
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