Answer the question
In order to leave comments, you need to log in
How to switch network from static IP addresses to DHCP?
I created a batch file with the following command: netsh interface ip set address name="Network connection name" source=dhcp (actually 6 lines, because there are 6 names of network connections in our network, somewhere it is "Local network" , somewhere "Local Area Connection 2", etc.).
Then I created a GPO, which I tied to the domain and set the batch file to start the computer (when I set it to "Users", nothing switched, probably the rights of the "User" account are not enough to change the network settings).
Now my computers with Windows XP switch to getting an address from a DHCP server on reboot, but not with Windows 7.
What can be done?
The second method with the command "wmic path win32_networkadapterconfiguration where "ipenabled = true" call setdnsserversearchorder(server dns address)" can't get it to work even for a test.
I also googled through the PSEXEC utility, but I also don’t think the rights are enough.
Answer the question
In order to leave comments, you need to log in
An example on Powershell in one line if there is exactly one network adapter in the system (you need to configure a powershell remote connection for the domain and somehow prepare a list of computers on which you want to run the script):
Basically this command:
(Get-WMIObject Win32_NetworkAdapterConfiguration | where{$_.IPEnabled -eq $true -and $_.DHCPEnabled -eq $false}).EnableDHCP()
you can put a script in powershell and execute using GPO
total in our network 6 types of network connections
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question