Windows管理员的三大心愿之一限制Windows用户的并发登录
2009-10-29 00:00:00 来源:WEB开发网以上是对并发登录限制三个方案的简单比较,很明显,不论是Windows管理员自己还是Microsoft,都在进步,我们期待更完美的解决方案。如果你有更好的方案,不妨与我们共享一下?
CLS
AT (1,1)
If @INWIN = 2 ; 表示客户计算机是Windows 95/98
$L = "@LSERVER" + "\" + "NETLOGON" + "\" + "WINSET.EXE"
shell "$L USERNAME=@USERID"
shell "$L HOMEDRIVE=X:" ; 你为用户映射的网络驱动器
shell "$L HOMEPATH=@HOMEDIR"
shell "$L HOMESHARE=@HOMESHR"
shell "$L COMPUTERNAME=@WKSTA"
shell "$L USERDOMAIN=@DOMAIN"
shell "$L LOGONSERVER=@LSERVER"
shell "$L USERPROFILE=@HOMESHR"
shell "$L OS=Windows_98"
setl "USERNAME=@USERID"
setl "HOMEDRIVE=X:"
setl "HOMEPATH=@HOMEDIR"
setl "HOMESHARE=@HOMESHR"
setl "COMPUTERNAME=@WKSTA"
setl "USERDOMAIN=@DOMAIN"
setl "LOGONSERVER=@LSERVER"
setl "USERPROFILE=@HOMESHR"
setl "OS=Windows_98"
endif
If @WKSTA <> "@LSERVER" ; 如果客户的工作站不是这台计算机
settime "@LSERVER" ; 把工作站的时间设置成服务器时间
endif
use X: "@HOMESHR" ;这是Kixtart中自带的Net use命令
$S = "@LSERVER" + "\" + "NETLOGON" + "\" + "users.txt"
IF INGROUP("users") and EXIST("$S")
Display "$S"
AT (23,1) "按任何键继续"
GET $A
endif
$B = "@LSERVER" + "\" + "NETLOGON" + "\" + "LOGBAT.BAT"
shell "$B"
CLS
BIG
$X = 1
DO
COLOR w/n
AT ( $X,$X*2 ) "@USERID"
$X = $X+1
UNTIL $X = 6
COLOR g+/n
AT ( $X,$X*2 ) "@USERID"
sleep 3
AT (23,0)
SMALL
$K=”@LSERVER”+”\”+”NETLOGON”+”\”+Onlyonce.txt”
$J=”x:\”+”@USERID”+”.txt”
if exist(“J$”)
goto done
endif
CLS
Display “$K”
Sleep 3
$RC=shutdown(“”,”正在关闭系统!”,0,1,0)
:done
cookie1 ; 需要通知Windows 98计算机当通过LMSCRIPT时脚本已经运行完毕
exit
更多精彩
赞助商链接