search cancel

Some commands related to Networking like Get-NetConnectionProfile is not woking on ITPAM Tool.

book

Article ID: 201527

calendar_today

Updated On:

Products

CA Process Automation Base

Issue/Introduction

Commands related to Networking like Get-NetConnectionProfile is not woking on ITPAM Tool.

Error message says

The term 'Get-NetConnectionProfile' is not recognized as the name of a cmdlet, function, script file, or operable program.  Check the spelling of the name or if a path was included, verify that the path is correct and try again.
At D:\PAM_Scripts\Temp\.c2otmp\f3606179-12b3-46c8-9a6a-081ee892ea87\c2ouscript.
ps1:40 char:25
+ Get-NetConnectionProfile <<<<
  + CategoryInfo       : ObjectNotFound: (Get-NetConnectionProfile:String) [], CommandNotFoundException
  + FullyQualifiedErrorId : CommandNotFoundException

Environment

Release : 4.3

Component : Process Automation

Resolution

Get-NetConnectionProfile is a Powershell command that is available on some versions of Powershell, but not others. For example, if you were to try to execute this command in Powershell on a Windows 7 machine, you’d get this message because it’s not available in the Windows 7 version of Powershell.

For versions of Windows where Get-NetConnectionProfile is not available, here’s another network connection test command that I’ve used before with better success. In this command, where you see "my.hostname" substitute the hostname of the computer you want to connect to, and where you see "123" substitute the port number you want to test:

$t = New-Object System.Net.Sockets.TcpClient 'my.hostname', 123; if($t.Connected) {"OK"}