Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- echo Batch pour forcer le paramétrage du proxy - Mathias B. Technology Inc 2013 -
- rem requête de l'IP
- @SET /P adresse=[Entrez l'adresse IP du poste]
- pushd \\UNC_PATH\TO\THE\SYSINTERNALS\EXE\
- rem extraction du SID de l'utilisateur connecté au poste distant
- rem premiere étape, trouver le samaccountname (%samAN%) à partir de l'IP via psloggedon.exe
- for /f %%a in ('Psloggedon.exe /accepteula \\%adresse% -l -x^|find /i "mdl"') do (set samAN=%%a)
- rem seconde étape, récuperer l'USID avec psgetsid.exe (%USID%)
- for /f %%b in ('Psgetsid.exe /accepteula \\%adresse% %samAN%^|find /i "S-1"') do (set USID=%%b)
- rem modification de la base de registre distante
- reg add "\\%adresse%\HKU\%USID%\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t REG_SZ /d adresse_du_proxy:port /f
- popd
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement