cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
chris_sterner
Engaged Sweeper II
If I run the same command on 10 machines, most will fail. Maybe 1 or 2 will pass. Then I run the exact same command again, and 2-3 more will pass. I run it again and usually the rest will pass. If I run a deployment on 100-200 machines at once, they all seem to fail. All the same commands and creds used. Here is what I used:


@ECHO OFF

set vardns1=XX.XX.XX.XX
set vardns2=XX.XX.XX.XX


ECHO Setting Primary DNS
netsh int ip set dns name = "Ethernet" source = static addr = %vardns1%

ECHO Setting Secondary DNS
netsh int ip add dns name = "Ethernet" addr = %vardns2%

ipconfig /flushdns

exit
3 REPLIES 3
chris_sterner
Engaged Sweeper II
nope, they are not. Most are. I was running 1 script with the name "Local Area Connection" and another with "Ethernet". But I was trying to find out if I could use a variable like "$Ethernet$" Not sure if that would work in netsh....
JacobH
Champion Sweeper III
oh - i just realized - are all the adapters named 'ethernet' ?





JacobH
Champion Sweeper III
Have you verified that the machines that report failed, indeed failed (i.e. rescan the asset and see what the DNS entries are in the network section of the asset)?

I find when I mess with the IPconfig in a deployment script, that it messes with the return of the success code of the script...