I have been trying to create a post login script that will change the default gateway to a specific IP and then renews its IP but haven’t had any luck. I know the normal cmd line is ipconfig \renew for renewing it IP. Any help would be appreciated.
Thanks
EDIT: I edited the old answer out as the changing dhcp to default gateway essentially makes it a new question.
Since you tagged powershell, the powershell way to do this is basically change this using WMI.
We can create the following function to do this:
*I haven’t explicitly tested this function.
Basically what we do, is get the number of our network adapter (index) based on it’s name (networkinterface). Then we get the AdapterConfiguration object associated with that interface, and then Set the Gateway to the new gateway, which is the second function parameter.
The other way to do it in batch would be to call the netsh program. I think what you’re looking for is along these lines.
* Again, I haven’t tested this.