I know how to change IP information with a command:
netsh interface ipv4 set address name="YOUR INTERFACE NAME" static IP_ADDRESS SUBNET_MASK GATEWAY
netsh interface ipv4 set dns name="YOUR INTERFACE NAME" static DNS_SERVER
But I must change IP information from multiple devices, and I would like to automatise this process with a script.
1. Manage this problem with a DHCP server is not an option.
2. All this information is currently fixed in each computer: IP address, subnet mask, gateway, primary dns and secondary dns.
3. Windows (7 and 10) with active directory environment. I have domain admin rights and remote connection to all my computers. All computers are under the same domain.
4. I should be able to launch remotely the script to all computers in the same location from a central server locate in that same location.
5. The script should change information from devices from IP .1 to .254
6. The network interface name is not the same in all the cases.
7. Some devices have multiples active network interfaces, but only network interface with fixed IP should be changed.
8. The fixed IP address should remain the same.
9. It only changes the last octet of:
9.1. Subnet Mask:
9.1.1. Example: [login to view URL] to [login to view URL]
9.2.1. Example: [login to view URL] to [login to view URL]
9.3. But it changes (subnet mask and gateway) according to their range:
9.3.1. Example: computers from .201 to .217:
220.127.116.11. Mask: [login to view URL]
18.104.22.168. Gateway: [login to view URL]
9.3.2. Example: computers from .81 to .95 and .106 to .123:
22.214.171.124. Mask: [login to view URL]
126.96.36.199. Gateway: [login to view URL]
10. The DNS (primary and secondary) should change for a new one in all the computers:
10.1. Example DNS1: 188.8.131.52 to [login to view URL]
10.2. Example DNS2: 184.108.40.206 to [login to view URL]
11. I should be able to use this script in a few more locations, those location have the same configuration, that’s why only the last octet of Subnet mask and Gateway should be changed.
Hello , So fine ? My Name is Pedro , i Work for I.T. it's a 2 Years , and become a Love computer it's a 18 Years OLD. I love a taked the project , no hard but need a time , please call-me in messsages for discuss