用命令查看整个AD域用户目前正在登录的计算机名,可以在域控制器上新建一个VBS文件,并将以下内容拷贝进去,然后运行该脚本文件,查看那些域用户登录在域中的那台客户端上。
‘ Scriptforgetting current logged user name on Domain
‘ Author : mwpq
‘
strDomainName = InputBox (“Please enter the internal Domain Name:”,”Script for getting current logged username”,”yourdomain.local”)
arrDomLevels = Split(strDomainName, “.”)
strADsPath = “dc=” & Join(arrDomLevels, “,dc=”)
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject(“ADODB.Connection”)
Set objcommand= CreateObject(“mand”)
objConnection.Provider = “ADsDSOObject”
objConnection.Open “Active Directory Provider”‘
Set objCOmmand.ActiveConnection = objConnection
mandText = _
“Select Name, Location from ‘LDAP://”&strADsPath&”‘ ” _