# Detect Virtual NIC Status

**URL:** <https://forums.powershell.org/t/detect-virtual-nic-status/551>\
**Category:** PowerShell Help\
**Created:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/detect-virtual-nic-status/551 "2011-12-31T18:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![archives](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@archives](https://forums.powershell.org/u/archives)\
**Post date:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/detect-virtual-nic-status/551/1 "2011-12-31T18:30:00Z")

</div>

by fangol at 2013-02-01 01:51:42

> Hi, I’m a beginner and I wondered if anyone could help me with this? I’m trying to create a PoSH script that will check whether the Virtual NIC status is Connected. Once the NIC is connected it just needs to exit. Any advice greatly appreciated!

by Klaas at 2013-02-01 04:36:11

> Do you want this only on your own machine, on a remote machine or on a collection of machines?  
> What do you mean by The virtual NIC? There can be a lot of them.  
> With WMI you can learn a lot from networkadapter and networkadapterconfiguration classes:  
> `Get-WMI -computername mypc -class win32_networkadapterGet-WMI win32_networkadapterconfiguration | Select *`

by fangol at 2013-02-01 07:58:43

> Hey thanks for your help, I figured it out, in this particular case there is a legacy adapter and a virtual adapter. I needed to know when the virtual adapter is up, I know once it has a default gateway that it is up so I did it this way. This works because the legacy adapter does not have a default gateway. Thanks for the tip.  
>   
> do{Get-WmiObject Win32\_NetworkAdapterConfiguration | Where-Object{$\_.description -like "_Virtual_"}|Select description,DefaultIPGateway}  
> until ($\_DefaultIPGateway -like "_192_")

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 9:02pm UTC](https://forums.powershell.org/t/detect-virtual-nic-status/551/2 "2024-05-16T21:02:16Z")

</div>


