Southwell Posted May 23, 2008 Posted May 23, 2008 Hi, Is it possible to reset a computers ip from fixed to DHCP via a script/gp setting? We are moving over curriculum this summer and making the whole site DHCP and didn't fancy resetting 200 admin machines Thanks
Diello Posted May 23, 2008 Posted May 23, 2008 netsh interface ip set address "Local Area Connection" dhcp ...should do it. 1
Geoff Posted May 23, 2008 Posted May 23, 2008 Yep, you can use the 'netsh' command to do this. Here is a KB article on the subject. How to Use the NETSH Command to Change from Static IP Address to DHCP in Windows 2000 1
browolf Posted May 23, 2008 Posted May 23, 2008 i reckon so, I've used a script to add WINS settings (using WMI) e.g. strComputer = args(0) changewins = args(1) if args.count > 0 then Set objWMIService = GetObject("winmgmts:\\" _ & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery( _ "SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True",,48) For Each objItem in colItems if (objItem.WINSPrimaryServer<>"") then wscript.echo strcomputer & "--> " & objItem.WINSPrimaryServer & "," & objItem.WINSSecondaryServer _ & " - " & objItem.ipaddress(0) 'objItem.Description if changewins="YES" or changewins ="yes" then if (objItem.WINSPrimaryServer<>"192.168.0.5")then intSetWINSServer = objitem.SetWINSServer(strWINSPrimaryServer,strWINSSecondaryServer) If intSetWINSServer = 0 Then WScript.Echo " Successfully set WINS servers." ElseIf intSetWINSServer = 1 Then WScript.Echo " Successfully set WINS servers BUT Must reboot." Else WScript.Echo " Unable to set WINS servers." end if end if end if end if Next else wscript.echo "To run this script:" wscript.echo "-------------------" wscript.echo VBCLF wscript.echo "c:\cscript winscheck.vbs " wscript.echo "where YES (optional) applies to whether to change WINS settings" end if 1
Southwell Posted May 23, 2008 Author Posted May 23, 2008 Thanks guys, ive done it like this and it's working perfectly netsh interface ip set address "Local Area Connection" dhcp netsh interface ip set address "Wireless Network Connection" dhcp netsh interface ip set dns "Local Area Connection" dhcp netsh interface ip set dns "Wireless Network Connection" dhcp
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now