< Back

Get-NetTCPConnection

Tue Jan 29, 2019 10:29 pm

NAME Get-NetTCPConnection



SYNOPSIS

Gets TCP connections.





SYNTAX

Get-NetTCPConnection [[-LocalAddress] <String[]>] [[-LocalPort] <UInt16[]>] [-AppliedSetting <AppliedSetting[]>] [-CimSession <CimSession[]>]

[-CreationTime <DateTime[]>] [-OffloadState <OffloadState[]>] [-OwningProcess <UInt32[]>] [-RemoteAddress <String[]>] [-RemotePort <UInt16[]>]

[-State <State[]>] [-ThrottleLimit <Int32>] [<CommonParameters>]





DESCRIPTION

The Get-NetTCPConnection cmdlet gets current TCP connections. Use this cmdlet to view TCP connection properties such as local or remote IP

address, local or remote port, and connection state.





PARAMETERS

-AppliedSetting [<AppliedSetting[]>]

Specifies an array of values of applied settings. The cmdlet gets connections that match the settings that you specify. The acceptable values

for this parameter are:



-- Internet

-- Datacenter

-- Compat

-- Custom



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-CimSession [<CimSession[]>]

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession

or Get-CimSession cmdlet. The default is the current session on the local computer.



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-CreationTime [<DateTime[]>]

Specifies an array of DateTime objects. To get a DateTime object, use the Get-Date cmdlet.



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-LocalAddress [<String[]>]

Specifies an array of local IP addresses. The cmdlet gets connections for the addresses that you specify.



Required? false

Position? 1

Default value none

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-LocalPort [<UInt16[]>]

Specifies an array of local ports. The cmdlet gets connections for the ports that you specify.



Required? false

Position? 2

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-OffloadState [<OffloadState[]>]

Specifies the offload state of a TCP connection.



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-OwningProcess [<UInt32[]>]

Specifies the PID of the owning process of a TCP connection.



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-RemoteAddress [<String[]>]

Specifies an array of remote IP addresses. The cmdlet gets connections for the addresses that you specify.



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-RemotePort [<UInt16[]>]

Specifies an array of remote ports. The cmdlet gets connections for the ports that you specify.



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-State [<State[]>]

Specifies an array of TCP states. The cmdlet gets connections that match the states that you specify. The acceptable values for this parameter

are:



-- Closed

-- CloseWait

-- Closing

-- DeleteTCB

-- Established

-- FinWait1

-- FinWait2

-- LastAck

-- Listen

-- SynReceived

-- SynSent

-- TimeWait



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-ThrottleLimit [<Int32>]

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0

is entered, then Windows PowerShell???? calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running

on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None









OUTPUTS

Microsoft.Management.Infrastructure.CimInstance#root\\StandardCimv2\\MSFT_NetTCPConnection



The Microsoft.Management.Infrastructure.CimInstance object is a wrapper class that displays Windows Management Instrumentation (WMI) objects.

The path after the pound sign (#) provides the namespace and class name for the underlying WMI object.





Example 1: Get all connections



PS C:\\>Get-NetTCPConnection



This command gets all current TCP connections.





Example 2: Get established connections



PS C:\\>Get-NetTCPConnection ????????State Established



This command gets all TCP connections that have an Established state.





Example 3: Get Internet TCP connections



PS C:\\>Get-NetTCPConnection ????????AppliedSetting Internet



This command gets all TCP connections that use a TCP applied setting of Internet.







RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=288389