向局域網內全部計算機添加輔助DNS

添加DNS命令:ide

netsh interface ip add dns "local area connection" 100.100.11.1
 
遠程命令:
psexec \\pcxxx -u global\xxxx -p ppppp netsh interface ip add dns "local area connection" 100.100.11.1 
 
bat文件(須要準備computername.txt)
for /f "tokens=1" %%a in (c:\temp\computername.txt) do (psexec \\%%a -u global\username -p password netsh interface ip add dns "local area connection" 100.100.11.1)
 
運行結果:
PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
 
Starting netsh on pcxxx...e on pcxxx...
netsh exited on pcxxx with error code 0.
相關文章
相關標籤/搜索