A Seyam A Seyam - 1 year ago 172
PowerShell Question

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"}


Answer Source

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}"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download