Advertisement
lincruste

Untitled

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