我可以通过以下 vbs 代码获取特定 ADS 用户的用户详细信息。
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand = CreateObject("ADODB.Command")
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
"<LDAP://"& objDomain.Get("distinguishedName") &">;" & _
"(&(objectclass=user)(objectcategory=person)(sAMAccountName=" & strUserName & "));" & _
"cn,displayName;subtree"
objCommand.Execute
在LCase
与. sAMAccountName
_ strUserName
这可能吗?