Problem:
I needed to find where a particular email address was being using within Active Directory as it had been duplicated. I needed to find it using PowerShell.
Solution:
Get-ADObject -Properties mail, proxyAddresses -Filter {mail -eq "accounts@earthport.com" -or proxyAddresses -eq "smtp:accounts@earthport.com"}
I was trying to do exactly the same thing: a big thank you.
Worked like a charm!
Thank you for this post!!
super simple, super helpful
If you don’t know the specific email address but only know a partial, I found this to be helpful:
Get-ADObject -Properties mail, proxyAddresses -Filter {mail -like “*accounts*” -or proxyAddresses -like “*accounts*”}