Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filter Arabic Words Using PowerShell

We have some accounts in the Active Directory with an Arabic display name and we want to change it to English, but I don't know how to get these accounts first using PowerShell. I use Quest ActiveRoles to query the Active Directory

Get-QADUser -SizeLimit 0 -SearchRoot "OU Location" | ? {$_.displayName -contains "The Arabic Letter Filter"}

Thanks

like image 401
A Seyam Avatar asked Mar 12 '23 00:03

A Seyam


1 Answers

You could test with a regular expression to find Arabic letters in the names. The following would yield True because of the Arabic letter (ـأ) in the middle of the word:

"Blaـأ‎Bla" -match "\p{IsArabic}"
like image 68
DAXaholic Avatar answered Mar 21 '23 04:03

DAXaholic