ConfigMgr 2012 – Collection Query With Special Characters

Posted in CM2012ConfigMgrQueriesSCCM

Recently had an issue at a client site where we wanted to query for all user accounts with “_a” at the end of the account.  Attempting to query for this didn’t work as we were getting back accounts that just ended with “a”.  The Like statement was “%_a”.

Turns out you need to put brackets around the underscore as it’s a special character.  So the proper query was “%[_]a”.

Thanks to this post by John Nelson that pointed me on the right path.

email

Written by , Posted .