Hello,
I need to change the DNS configuration of users machines based on their circumstances. If they are using a VPN to access a page it needs to be one thing, if they are connecting through the office it needs to be another. I have managed to successfully do this using netsh for example :
Set WshShell = WScript.CreateObject("Wscript.Shell")
WshShell.Run "cmd /c netsh interface ip set DNS ""Local Area Connection"" Static 123.242.121.23",0
However if the user is connecting using Local Area Connection 2 or Local Are connection 7 etc this script won't work and is causing problems.
Is there a way of detecting which Local Area Connections are being used by the machine, and then is there a way of running the script above but having ""Local Area Connetion"" being a variable, where the variable is assigned the value of the Local Area Connection on the Users PC. So if i was conencted using LAN 3 it would input ""Local Area Connection 3"" where ""Local Area Connection"" is.
Thanks in advance for any guidance, pointers, code snippets, advice anything thanks,
I need to change the DNS configuration of users machines based on their circumstances. If they are using a VPN to access a page it needs to be one thing, if they are connecting through the office it needs to be another. I have managed to successfully do this using netsh for example :
Set WshShell = WScript.CreateObject("Wscript.Shell")
WshShell.Run "cmd /c netsh interface ip set DNS ""Local Area Connection"" Static 123.242.121.23",0
However if the user is connecting using Local Area Connection 2 or Local Are connection 7 etc this script won't work and is causing problems.
Is there a way of detecting which Local Area Connections are being used by the machine, and then is there a way of running the script above but having ""Local Area Connetion"" being a variable, where the variable is assigned the value of the Local Area Connection on the Users PC. So if i was conencted using LAN 3 it would input ""Local Area Connection 3"" where ""Local Area Connection"" is.
Thanks in advance for any guidance, pointers, code snippets, advice anything thanks,