p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

proasp_howto thread: LDAP - getting user login names

Message #1 by "Gilian Leech" <gillianleech@h...> on Tue, 3 Dec 2002 13:02:56
Thanks Phil, that worked a treat

> No, Instr is case-sensitive by default.  Adding a 4th param with value 
v> bTextCompare (=1) will sort this out.

> hth
P> hil
>> -----------------------------------------------
H> > i,

> > I'm using LDAP to return user login names in a specific OU.  I then 
t> > o check to see whether the person logged on to the website is in that 
O> > U.  

> > I can do this but, the login coming back has to match the login in 
i> > .e. the names are case sensitive.  Is this correct?

> > For example I am logged on to my PC as 'BLOGGS', but the account in 
h> > as been created as 'bloggs'.  LDAP isn't recognising the name, until 
l> > og off and log back, putting my username in lowercase

> > Here's my code:

> > Search = "LDAP://OU=MU_OU,OU=London,DC=MyDomain,DC=com"
F> > ilter = "(objectCategory=person)"
A> > ttribs = "sAMAccountName"',userPrincipalName, ADsPath"
S> > cope = "subtree"

> > While Not objRecordset.EOF
R> > esponse.write "<tr>"
F> > or Each objField In objRecordset.Fields
R> > esponse.Write "<TD>"
o> > bjField.Value
I> > f Instr(1, objField.Value, strUserName) Then Session("Permission") 
=>  "OK"
R> > esponse.Write "</TD>"
N> > ext
R> > esponse.Write "</tr>"
o> > bjRecordset.MoveNext
W> > end

  Return to Index