CodexBloom - Programming Q&A Platform

PowerShell 7.3 - implementing Retrieving AD User Properties with Non-Standard Characters in Names

👀 Views: 78 💬 Answers: 1 📅 Created: 2025-06-13
powershell active-directory ldap PowerShell

This might be a silly question, but Can someone help me understand I'm trying to retrieve Active Directory user properties using PowerShell 7.3, but I'm working with issues when the usernames contain non-standard characters such as accents or special symbols. For instance, when I execute the following command: ```powershell Get-ADUser -Filter "Name -like '*é*'" -Properties EmailAddress ``` I expect to retrieve users with names like 'José' or 'Müller', but the command returns no results. I've tried escaping the characters with backticks and also using `-Filter *`, but that retrieves all users and is not efficient for my needs. Additionally, when I use the `-LDAPFilter`, I get an behavior stating "Invalid syntax in the filter." Here's what I tried: ```powershell Get-ADUser -LDAPFilter "(cn=*é*)" -Properties EmailAddress ``` Could the scenario be related to how PowerShell handles Unicode characters in Active Directory queries? Is there a best practice for dealing with this scenario? Any suggestions on how to correctly query for these users without running into performance optimization would be greatly appreciated. For context: I'm using Powershell on CentOS. Any pointers in the right direction? My team is using Powershell for this mobile app. Is this even possible?