Forum Discussion
Tech_Guy-3000
Apr 23, 2024Copper Contributor
Query for user or users in Exchange online
I have a slightly different version of this posted elsewhere. Can I, in Exchange online, run a query that will for example:
1. Give me all users with a specific company name-i.e. all users where company name matches xxx
2. Give me all users where company name matches xxx OR state=ny
I'm looking to construct some lists but it would be very helpful to just pull back, throw some queries out, get results and then fine tune from there. I don't see (or haven't used the right terms) a way to do this from online KB articles
2 Replies
- Most Exchange cmdlets support -Filter, so you can do it like:
Get-User -Filter {Company -eq "XXX"}
If the idea is to use this for DDGs, best use the Get-Recipient cmdlet and -RecipientPreviewFilter.- Tech_Guy-3000Copper ContributorThank you Vasil, I appreciate your help on both of them. Right now it's boolean 101 for me. Try a wide query see what I get and add things I know are there to confirm syntax.