用命令行工具来注销相同或不同域内的服务器上的登录用户

Windows服务器上只允许两个用户远程登录,如果有很多人使用该服务器,而有人经常不是注销而是直接断开连接。就经常会遇到这个消息:超出服务器最大连接数
“The terminal server has exceeded the maximum number of allowed connections” 。


如果可以登录到其它服务器,可以用Terminal server Manager来连接该服务器并查看登录用户的状态,从而决定注销哪个用户会话。而这个工具似乎连不上其它域的服务器。。。
下面是用命令行工具来实现此操作:
首先,你必须拥有该服务器的实现此操作的管理员权限,使用以下命令来应用该用户的权限:
rel="File-List" href="file:///C:%5CUsers%5Cevanlin%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"> rel="themeData" href="file:///C:%5CUsers%5Cevanlin%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"> rel="colorSchemeMapping" href="file:///C:%5CUsers%5Cevanlin%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"> net use /user:[username] //servername/share


然后,用以下命令来查询服务器上的用户会话:
rel="File-List" href="file:///C:%5CUsers%5Cevanlin%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"> rel="themeData" href="file:///C:%5CUsers%5Cevanlin%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"> rel="colorSchemeMapping" href="file:///C:%5CUsers%5Cevanlin%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml">

query session /server:servername



接着,用以下命令来查询用户会话的状态:
rel="File-List" href="file:///C:%5CUsers%5Cevanlin%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"> rel="themeData" href="file:///C:%5CUsers%5Cevanlin%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"> rel="colorSchemeMapping" href="file:///C:%5CUsers%5Cevanlin%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml">

query user /server:servername



最后,决定踢掉哪个用户会话后,用以下命令来实现:
rel="File-List" href="file:///C:%5CUsers%5Cevanlin%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"> rel="themeData" href="file:///C:%5CUsers%5Cevanlin%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"> rel="colorSchemeMapping" href="file:///C:%5CUsers%5Cevanlin%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml">

reset session /server:servername




转载自:
Command Line Hack for: "Terminal Server Has Exceeded the Maximum Number of Allowed Connections"
http://www.howtogeek.com/howto/windows/command-line-hack-for-terminal-server-has-exceeded-the-maximum-number-of-allowed-connections/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值