如何从LDAP获取所有字段?
我正在尝试使用此代码获取某些字段:
Set objRoot = GetObject("LDAP://RootDSE")
Domain = objRoot.get("defaultNamingContext")
Set cn = CreateObject("ADODB.Connection")
Set cmd = CreateObject("ADODB.Command")
Set rs = CreateObject("ADODB.Recordset")
cn.Open "Provider=ADsDSOObject;"
cmd.activeconnection = cn
strAttributes = "cn,ou,sn,mail"
cmd.CommandText = "SELECT " & strAttributes & " FROM 'LDAP://" & Domain & "' WHERE sAMAccountName = '" & VBA.Environ("UserName") & "'"
Set rs = cmd.Execute
但是如何查看所有可用字段(属性)?通配符星号似乎只返回ADsPath
字段。