Get-Nettcpconnection question for remote computer

Kaplan, Andrew H 81 Reputation points


I am experimenting with the Get-Netcpconnection command, and I am trying to combine the '-AppliedSetting Internet' option with 'CimSession' in order to get the intended output for a remote system. I am having problems getting the two to work together, so I wanted to know is there a way to so, or should I try something else?

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,085 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Nathan Giannini 161 Reputation points

    Assuming you have appropriate access, and there is a MSFT_NetTCPConnection object with the property 'AppliedSetting' that is equal to 'Internet', something like this should do the trick:

    $cimSession = New-CimSession -ComputerName <ComputerName>
    Get-NetTCPConnection -AppliedSetting Internet -CimSession $cimSession

    Best Regards,

    Nathan Giannini

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments