Check Email forwarding using Powershell !!!


Being a system admin is not only about the doing the Job but doing it efficiently.

This post will show you how to find out users who have email forwarding to to any person within the exchange server.

1) Open the exchange power shell.

2) Type the following command.

Get-Mailbox -Filter {ForwardingAddress -ne $null} | ft Name,ForwardingAddress,DeliverToMailboxAndForward -Autosize

Breaking the code :-
  • Get-mailbox module :- is used to find out the information within the mailbox.
  • Filter {ForwardingAddress -ne $null} :- filters the output with an forwarding emailaddress is not equal to $null (no empty)
  •  ft Name,ForwardingAddress,DeliverToMailboxAndForward : again filter the output with only these columns (name, Forwarding address, deliver to mailbox and forward).
  •  -Autosize : if your output is too big, the full output is not shown and items that are over a certain entry are not shown, to avoid this and to output all details we use -autosize
  • you can also re-direct this output from the screen to a file using 'Export-CSV' parameter. 
  • e.g.  Get-Mailbox -Filter {ForwardingAddress -ne $null} | ft Name,ForwardingAddress,DeliverToMailboxAndForward -Autosize | Export-CSV g:\Email_forwarding_output.csv

Note : Please try the command at your own risk, the owner of this blog takes no responsibility for anything that may go wrong on your exchange server.

3 comments:

  1. I’m really impressed with your article, such great & usefull knowledge you mentioned here
    mail forwarding address

    ReplyDelete
  2. This post is likeable, and your blog is very interesting, congratulations.
    mail forwarding address

    ReplyDelete
  3. You have got some great posts in your blog. Keep up with the good work.
    mail forwarding address

    ReplyDelete