A question came up in the forums today about how to use the AD Powershell cmdlets to find objects with attribute values that contain a single space. It’s a good question and relevant because often your results can be skewed by such values when searching for attributes that are not NULL (a space character is not a NULL). Anyway, here’s an example of how to do it using the LDAPFilter.
Get-ADUser -LDAPFilter "(telephonenumber=\20)"
The “\” is the standard escape character for use in LDAP searches and “20” is the HEX representation of the space character.
The filter should also work with other LDAP clients (e.g. LDP.EXE).