P
Paolo Debetto
Hi
I have a user's login name obtained with
loginName = CreateObject( "WScript.Network" ).userName
How can i get the LDAP descriptor from this?
I've tried with a query to the ADODB, e.g.
strBase = "<LDAP://dc=myDomain,dc=com>"
strFilter = "(&(objectCategory=person)(objectClass=user)(*********=" &
loginName & "))"
strAttributes = "distinguishedName,cn"
strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
Set objCommand = CreateObject("ADODB.Command")
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
objCommand.ActiveConnection = objConnection
objCommand.CommandText = strQuery
Set objRecordSet = objCommand.Execute
It works, but I don't know what to put instead of **********...
Thanks in advance
I have a user's login name obtained with
loginName = CreateObject( "WScript.Network" ).userName
How can i get the LDAP descriptor from this?
I've tried with a query to the ADODB, e.g.
strBase = "<LDAP://dc=myDomain,dc=com>"
strFilter = "(&(objectCategory=person)(objectClass=user)(*********=" &
loginName & "))"
strAttributes = "distinguishedName,cn"
strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
Set objCommand = CreateObject("ADODB.Command")
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
objCommand.ActiveConnection = objConnection
objCommand.CommandText = strQuery
Set objRecordSet = objCommand.Execute
It works, but I don't know what to put instead of **********...
Thanks in advance