我们都知道,在域AD环境下域用户账户默认是可以登陆到除DC外的任意计算机客户端的,这就让一些别有用心的员工找到漏洞了,这样他就可以登陆别人的计算机去获得他想要的资料了,这样对一个企业来说是非常不安全的,那么应该如何解决这个问题呢?OK,入正题。这里介绍两种方法,不过还是用第一种方法比较灵活,第二种方法比较复杂而且也带有漏洞。第一个办法:1、在域帐号的属性中设置。打开该帐号的属性,帐户页面,登录到,如下图所示:然后在登录工作站选择“下列计算机”;将要登录到的计算机名字填写,然后确定,即可。3.测试,当使用该帐号没有登录到指定的计算机的时候,系统会提示错误,如下图所示:到此设置完毕。第二个办法:1、准备两个脚本。一个用于用户登入时执行的login.vbs,另一个是用于注销时使用的logoff.vbs
2、为配合脚本,我们需要在DC上创建一个共享文件夹,让所有用户拥有更改的权限!3、建立一条组策略A、准备脚本(我会在本文最后提供脚本给大家分享)B、创建共享文件夹Userinfo(为避免用户错误,我尽量详尽)创建共享及并给用户以变更权限开始将我们的login.vbs这个脚本加入到启动指令中。在这一切设置完毕之后,为了加速就用的时候,我们在GPMC管理工具上将这个策略设置成强制。并重启我们的客户端计算机,当然你也可以先执行gpupdate/force这个命令来强行的刷新组策略!将这个策略设置成强制。原理:两个脚本是用来记录用户所登入与登出的计算机时间,在一个用户登入后,会立即写下当前的记录,如果用户使用同一个账户在另一个计算机上登录时就会报警。现在我们来看看用户登陆后,在共享资料夹里产生的文件!它的文件命名方式以用户的登陆名为主!下面这个文件是MIS-04登入计算机后产生的,我们可以清楚的看到MIS-04这个用户所登入的计算机及时间!通过这种方式,如果MIS-04再登入其他的电脑的话,VBS会检查这个档里面的信息,当他发现MIS-04已经登入一台电脑了,并且没有注销。它就会自动退出!login.vbs代码:DimoNet,sUser,sComputer,ServerLog
ServerLog="\\192.168.1.1\Userinfo\"
SetoNet=CreateObject("work")
sUser=oNet.UserName
sComputer=puterName
SetoNet=Nothing
Dimfso,f1,WshShell,argu,alllog,lastlog
DimFileName
FileName=ServerLog&sUser&".txt"
Setfso=CreateObject("Scripting.FileSystemObject")
IfNot(fso.FileExists(FileName))Then
Setf1=fso.CreateTextFile(FileName,True)
f1.WriteLinesUser&""&sComputer
f1.Close
SetWshShell=Wscript.CreateObject("Wscript.Shell")
argu=FileName&"/T/E/G"&sUser&":f/REveryone"
WshShell.run("cacls"&argu)
SetWshShell=Nothing
EndIf
Setf=fso.GetFile(Filename)
intSizeB=f.Size
ifintsizeB=0then
alllog=""
lastlog=""
endif
ifintsizeB>0then
setf1=fso.OpenTextFile(Filename,1,True)
alllog=f1.readall
f1.close
setf1=fso.OpenTextFile(Filename,1,True)
lastlog=f1.readline
f1.close
endif
IfLeft(lastlog,5)="logon"Then
IfInStr(lastlog,sComputer)
Setf1=fso.OpenTextFile(FileName,2,True)
f1.WriteLine(lastlog&Chr(13)&Chr(10)&"FailLogon:"&Now()&""&sUser&"at"&scomputer&Chr(13)&Chr(10)&alllog)
f1.Close
SetWshShell=Wscript.CreateObject("Wscript.Shell")
Dimi,OldComputer
i=InStr(lastlog,"at")
OldComputer=Right(lastlog,Len(lastlog)-i-2)
WshShell.popup"对不起:此账号已经在"&OldComputer&"上登入使用!出现此提示的可能情况如下:1、您在其他电脑上登陆的帐户未及时注销。2、您上次非法关闭计算机或者意外停电。3、如果您确认未发生上述2种情况,那么可能您的帐户被盗。对于2、3情况请及时上报IT支持,谢谢!!!",30
SetWshShell=Nothing
Dimos,retcode
ForEachosInGetObject("Winmgmts:{impersonationLevel=impersonate,(shutdown,remoteshutdown)}!//"+sComputer).InstancesOf("Win32_OperatingSystem")
retcode=os.Win32ShutDown(4,0)
Next
Wscript.quit
Else
Setf1=fso.OpenTextFile(FileName,2,True)
f1.WriteLine("logon:"&Now()&""&sUser&"at"&sComputer&Chr(13)&Chr(10)&alllog)
f1.Close
EndIf
Else
Setf1=fso.OpenTextFile(FileName,2,True)
f1.WriteLine("logon:"&Now()&""&sUser&"at"&sComputer&Chr(13)&Chr(10)&alllog)
f1.Close
EndIf
Setf1=Nothing
Setfso=Nothing
Wscript.quit
logoff.vbs代码dimoNet,sUser,sComputer,ServerLog
ServerLog="\\192.168.1.1\Userinfo\"
setoNet=createobject("work")
sUser=oNet.UserName
sComputer=puterName
setoNet=nothing
dimfso,f1,alllog,lastlog
DimFileName
FileName=ServerLog&sUser&".txt"
setfso=createobject("Scripting.filesystemobject")
IfNot(fso.FileExists(FileName))Then
Setf1=fso.CreateTextFile(FileName,True)
f1.WriteLinesUser&""&sComputer
f1.Close
SetWshShell=Wscript.CreateObject("Wscript.Shell")
argu=FileName&"/T/E/G"&sUser&":f/REveryone"
WshShell.run("cacls"&argu)
SetWshShell=Nothing
EndIf
Setf=fso.GetFile(Filename)
intSizeB=f.Size
ifintsizeB=0then
alllog=""
lastlog=""
endif
ifintsizeB>0then
setf1=fso.OpenTextFile(Filename,1,True)
alllog=f1.readall
f1.close
setf1=fso.OpenTextFile(Filename,1,True)
lastlog=f1.readline
f1.close
endif
ifleft(lastlog,5)="logon"Then
IfInStr(lastlog,sComputer)>0Then
Setf1=fso.opentextfile(FileName,2,true)
f1.writeline("logoff:"&Now()&""&suser&"at"&scomputer&
Chr(13)&chr(10)&alllog)
f1.close
EndIf
endif
setf1=nothing
setfso=nothing
wscript.quit
要管理组策略 您必须以域用户账户登录此计算机 让AD域用户账户只能登陆管理员指定的客户端计算机...
如果觉得《要管理组策略 您必须以域用户账户登录此计算机 让AD域用户账户只能登陆管理员指定的》对你有帮助,请点赞、收藏,并留下你的观点哦!