SOLVED

List of all different emails that are auto forwarded to the mail enabled Public folder address

Copper Contributor

Hi

Can someone help me to know how can i get list of all different emails that are automatically forwarded to the mail enabled public folder address in office365 / @ExchangeOnline . Any powershell command or process, please let me know. 

Thank you in advance.

 

Regards,

Nitin Singh

8 Replies
The fastest way would be to use a filter based on the PF address, for example:

Get-Mailbox -Filter {ForwardingSmtpAddress -eq "smtp:email address removed for privacy reasons"}

@Vasil Michev First of all its an honor to get response from you as many times your replies and shared answers on multiple forum  in past have helped me.

 

I tried your above suggestion but it does not give me any result as seen in below snip.

I have set forwarding on test-migration mail enabled PF to email address testing01 PF address and as per command i ran in snip , i should get result of test-migration PF details in ideal scenario but it finishes without any output result. please advise if i am doing anything wrong or need to modify command again.

TIA

 

Nitin_Singh_0-1662020583134.png

 

First, let me check if I understand the query here correctly, are you looking to find out all objects that have some sort of forwarding set to the PF? Or do you want to list individual messages forwarded to the address?
I need to find out all objects(mailboxes or Groups or Other mail enabled PF) details either mail address or display name that have auto-forwarding set to the concerned target PF address (mail delivered to testing01 PF address).
best response confirmed by Nitin_Singh (Copper Contributor)
Solution
Covering MEPFs is a bit tricker, as server-side filtering doesn't work. So you can do something like this:

Get-MailPublicFolder | ? {$_.ForwardingAddress} | select Alias,ForwardingAddress

For groups, you need to check membership instead. And you might want to cover mail flow rules/inbox rules, if you are unsure of the type of forwarding configured.

Hi Vasil,
It worked and i could export list of PF addresses on which auto forwarding set to other PF mailboxes.
Only thing left is we could not any get any recipient or shared mailboxes or Groups details on which auto forwarding was set to PF mail address through above shared command.
Let me know if this can be also achieved?
TIA

Shared mailboxes should be covered by the Get-Mailbox cmdlet above. M365 Groups do not have a "forwarding" attribute, and MEPF cannot be added as members therein, so you can skip them. You can check DG membership and Inbox/mail flow rules.
I was able to fetch list of MEPE on which autoforwarding are setup from backend with your shared command and similarly for mailboxes as well.
Thank you very much for your help VASIL, you are a genius and master of O365 world!!!
1 best response

Accepted Solutions
best response confirmed by Nitin_Singh (Copper Contributor)
Solution
Covering MEPFs is a bit tricker, as server-side filtering doesn't work. So you can do something like this:

Get-MailPublicFolder | ? {$_.ForwardingAddress} | select Alias,ForwardingAddress

For groups, you need to check membership instead. And you might want to cover mail flow rules/inbox rules, if you are unsure of the type of forwarding configured.

View solution in original post