sAMAccountName and Regular Expressions


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.
Who is Participating?
Unfortunately it doesn't look like it.
Wild cards yes, REs no.
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.