


I think you want to look at IPv4Connectivity or IPv6Connectivity, depending on what you're using. I know I can do what I need to with a several lines, but I'm trying to keep it as short as possible. Now the $64,000 question, can either of you (or anybody else) tell me if this is available from the MSFT_NetConnectionProfile class of the root/StandardCimv2 namespace using either WMIObject or CIMInstance?īasically, I'm trying to test for the presence of a specific network connection for a script run from Task Scheduler (since the Network Condition doesn't seem to work), and I'm trying to just add one line to several existing scripts. Thanks guys, apparently I'm looking for the Status property for my test condition. Get-CIMInstance will also generally be faster than Get-WMIObject.

WinRM is what powershell uses for remote sessions so powershell commands are largely CIM based. The biggest difference is that WMI will use DCOM and CIM will use WinRM. The get-networkAdapter command uses CIM to get the information it presents to you. To answer you second question, they are basically the same thing. Object ConvertToDateTime () MSDN ScriptMethod System. Object ConvertFromDateTime () ConvertToDateTime ScriptMethod System. ManagementObject #root\StandardCimv2\MSFT_NetConnectionProfile Name MemberType Definition - PSComputerName AliasProperty PSComputerName = _SERVER Caption Property string Caption ConvertFromDateTime ScriptMethod System. Powershell $Test2 = Get-WmiObject -Namespace root / StandardCimv2 -Class MSFT_NetConnectionProfile $Test2 | Get-Member TypeName : System. 2 Hyper-V Virtual Ethernet Adapter #2 10 Up 02-15-51-DF-C1-F2 10 Gbps Ethernet Intel ( R ) Ethernet Connection I219-LM 6 Up C8 - 5B - 76 - 36-BE - 05 1 GbpsĪs an additional question, how do either of these properties relate to properties of either 7 Disconnected E4-B3 - 18-E0-BB-B2 3 Mbps Get-NetAdapter | where -Property Status -EQ 'Up' Name InterfaceDescription ifIndex Status MacAddress LinkSpeed - vEthernet ( Default Sw.

2 Hyper-V Virtual Ethernet Adapter #2 10 Up 02-15-51-DF-C1-F2 10 Gbps Wi-Fi Intel ( R ) Dual Band Wireless-AC 8260 8 Disconnected E4-B3 - 18-E0-BB-AE 0 bps Ethernet Intel ( R ) Ethernet Connection I219-LM 6 Up C8 - 5B - 76 - 36-BE - 05 1 Gbps Bluetooth Network Conn. Powershell Get-NetAdapter | where -Property AdminStatus -EQ 'Up' Name InterfaceDescription ifIndex Status MacAddress LinkSpeed - vEthernet ( Default Sw.
