I am trying to write a VBScript that will search an external UNIX
directory based on a person's last name and first name.
I currently have a script that can search for the user's login id and
give me the first and last name:
--Begin Script--
CONST ADS_NO_AUTHENTICATION = &H0010
CONST ADS_SERVER_BIND = &H0200
sLDAPsrv = "ldap.server.edu"
sLDAPsb = "ou=people,o=server.edu"
sCN = InputBox("Enter UNIX ID:")
sRoot = "LDAP://" & sLDAPsrv & "/uid=" & sCN & "," & sLDAPsb
sDN = "cn=" & sCN & "," & sLDAPsb
Set oDSP = GetObject("LDAP:")
Set oUser = oDSP.OpenDSObject(sRoot,vbNullString,vbNullString,ADS_SERVER_BIND
AND ADS_NO_AUTHENTICATION)
oUser.GetInfo
strName = oUser.givenName
strLast = oUser.sn
MsgBox strName
MsgBox strLast
wscript.Quit
--End Script--
That works great, but I am unable to determine how to search for the
last and first name using the same methods and get the uid. I have
searched everywhere I can think, but most of what I find is either
exclusive to AD or exclusive to UNIX.
Help?
Thanks in advance,
Dan