|
-
Jul 26th, 2005, 07:09 PM
#1
Thread Starter
New Member
Quick Active Directory LDAP query variable issue
I have the following:
LDAP://ou=X,dc=X,dc=X;(&(objectCategory=person)(objectClass=user)(sAMAccountName=strCuruser));sAMAccountNam e,altRecipient,mailNickname;subtree
I need strCuruser to be a variable in (sAMAccountName=strCuruser).
How should I enclose strCuruser to set it as a variable?
-
Jul 27th, 2005, 01:08 PM
#2
New Member
Re: Quick Active Directory LDAP query variable issue
For any active directory functions I always refer to this posting on code project. Pretty much exposes anything you would want to do with LDAP.
-
Jul 27th, 2005, 03:15 PM
#3
Frenzied Member
Re: Quick Active Directory LDAP query variable issue
VB Code:
Dim ldap as String = String.Format("LDAP://ou=X,dc=X,dc=X;(&(objectCategory=person)(objectClass=user)(sAMAccountName={0}));sAMAccountName,altRecipient,ma ilNickname;subtree", TextBox1.Text)
replace textbox1.text with however you retrieve the name you want.
-
Jul 27th, 2005, 03:37 PM
#4
Thread Starter
New Member
Re: Quick Active Directory LDAP query variable issue
Thanks,
I figured this out earlier. This is what I did.
strSam = "(sAMAccountName=" & strCuruser & "))"
strFilter = "(&(objectCategory=person)(objectClass=user)" & (strSam)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|