Check if mediastate is disconnected

by Kallebaah at 2012-11-08 03:17:47

HI i need som help getting a powershell script that checks if mediastate on Tunnel adapter Teredo Tunneling Pseudo-Interface is disconnected.
what i need is like the example below if the interface is disconnected i want it to write No VPN and if it´s connected i want VPN Connected

if (ipconfig | Select-String ‘Tunnel adapter Teredo Tunneling Pseudo-Interface’) { Write-Host ‘VPN Connected’ } else { Write-Host ‘No VPN’ }

Can anyone help me with this?? i need it to set a custom requirement on a deployment type thats required but it should not install if they are connected thru direct access.
by DonJ at 2012-11-08 11:10:18
I don’t think this is really a System Center question. As far as I’m aware, SCCM doesn’t track the current connectivity state of network adapters, as that information is subject to frequent change.

Would you mind posting this in an appropriate discussion forum here?

In the meantime, look at … 16(v=vs.85).aspx. This class may have a property that lets you determine the connection status.
by Kallebaah at 2012-11-08 23:16:25
Hi the reson i posted it in System Center is that i sccm 2012 i would like to put a custom requirement for an deploymenttype. you can run powershell script directly in the deployment type. So i thought it would be the rigt place to put it