Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2145
  • Last Modified:

sAMAccountName and Regular Expressions

Hi,

Does anyone know if we can use regular expressions in LDAP query for sAMAccountName attribute???

I have an LDAP filter to import users from AD into SharePoint profiles. I want to import just the users with "sAMAccountName=123456" (only numbers-6 digits long). The reason is I want to avoid importing generic user accounts which have alpha values in sAMAccountName.

I tried : sAMAccountName=[0-9]{6}  which didn't help.

I really appreciate any help.
0
BoozTech
Asked:
BoozTech
1 Solution
 
QPRCommented:
Unfortunately it doesn't look like it.
Wild cards yes, REs no.
http://stackoverflow.com/questions/6293231/ldap-search-using-regular-expression
0
 
BoozTechAuthor Commented:
Thank you. I guess I will have to find an attribute which I can use in my LDAP query for users with all numeric sAMAccountName.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now