There are three methods for this
method 1;
method 3:
method 2:
1) Export the network settings using the following command: netsh -c interface dump > PATH_AND_FILENAME.txt for example you can use a flash drive for this. It might be best to name this file default.
2) Alter that computer setting up Cisco DNS as shown https://support.opendns.com/hc/en-us/articles/228006987-Windows-7
3) Export the network settings using the following command netsh -c interface dump > PATH_AND_FILENAME.txt
4) gather computers names through a dsquery command
This step should be done on a domain controller
dsquery * -filter "(objectCategory=Computer)" –attr name < computers.txt
alternatively this could be done by net view on a smaller business environment
net view > computers.txt
5) netsh to set remote computer group to use opendns DNS settings from the text file gathered in step 3
Maintenance.bat
FOR /F "tokens=*" %%A in (computer.txt) DO GOTO=Funt: :Funt set var = tokens netsh -r %var% -f PATH_AND_FILENAME.txt echo %var% ENDLOCAL
normal.bat
FOR /F "tokens=*" %%A in (computer.txt) DO GOTO=Funt: :Funt set var = tokens netsh -r %var% -f PATH_AND_FILENAME.txt echo %var% > success.txt ENDLOCAL
Diffs.bat
@echo on cd path for /f %%a in (computers.txt) do ( for /f %%b in (success.txt) do ( if %%a==%%b () else (netsh interface ip set dns "Local Area Connection" dhcp ) )
No comments:
Post a Comment