Quantcast
Channel: Exchange Server 2010 forum
Viewing all articles
Browse latest Browse all 8820

Powershell to find all mailboxes using non-default domain

$
0
0

We have a number of default e-mail domains for various staff. We are applying a retention policy only to the default domain, not to the others. So I need to find a way to find all mailboxes whose reply-to domain is not MyDomain.com. I know the prefix will be SMTP:, but the domain is sometimes listed as mydomain or MyDomain, so it seems trying to use case sensitivity on the string won't work.

I was trying to use something like:

get-mailbox -resultsize unlimited | where-object {$_.EmailAddresses -notlike 'SMTP:*@mydomain.com'}

Suggestions are appreciated.


Viewing all articles
Browse latest Browse all 8820

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>