Hi folks
I found this section of script useful.. sourced from FreeVBCode.com
My question is this ..
How can I return information from AD based on input which is user intials ? Assume that a unique combo of initals is used .
‘==============================
Set oRoot = GetObject(“LDAP://rootDSE”)
‘work in the default domain
sDomain = oRoot.Get(“defaultNamingContext”)
Set oDomain = GetObject(“LDAP://” & sDomain)
sBase = “”
‘Only get user name requested
sFilter = “(&(objectCategory=person)(objectClass=user)(name=” _
& LoginName & “))”
‘ ———————————
‘can we modify the line above for user initials
‘———————————
sAttribs = “adsPath”
sDepth = “subTree”
sQuery = sBase & “;” & sFilter & “;” & sAttribs & “;” & sDepth
conn.Open _
“Data Source=Active Directory Provider;Provider=ADsDSOObject”
Set rs = conn.Execute(sQuery
‘===========================
Thanks in advance
Geof