Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Search Active Directory where the UPN contains numbers?

$
0
0

Right now I have the following search.fiter but it would be nice if I could get my search to return any results where there is a combination of numbers. I have noticed a few accounts in AD that have UPNs that are not correctly configured e.g. BB434343@domain.com. I want to find all of those that have numbers in them. There will be cases where there should be a number such as batty.boy1@domain.com.  So I'm thinking a something like in sql where you can query the value that contains more than 1 number.  so bob1 would return but bob11 would

Im stumped on this, hoping for help!

search.Filter = "(&(objectClass=User) (userPrincipalName=*" + username + "*))";''

Cheers


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>