Thanks for your help with this Paul. I haven't forgotten about this. The function can currently tell if the corporate resources are available or not. It cannot tell if you're at home and connected via VPN or if you're in the office connected directly to the intranet. The second is what I optimally want to be able to determine. However, DirectAccess makes this difficult by default because the default option is to not show the network adapter being used for VPN connection as connected. Because of this, I need to do some more research into how I can reliable detect the DirectAccess VPN connection. Perhaps I can use routing table information for network adapters. Other promising avenues to explore would be to use the INetworkConnection interface introduced in Vista (http://msdn.microsoft.com/en-us/library/aa370751(VS.85).aspx) and/or the GetBestInterfaceEx API. These last two can also give us reliable information on whether or not we are connected to the intranet via wired connection. This would also help us improve the Test-NetworkConnection function in the toolkit because the current WMI method will not necessarily work in all scenarios. Anyways, I will do some more work on this and get back at a later date.
↧