Solved

i need a powershell command that looks for ForwardingSMTPAddress in OU

Posted on 2014-11-06
2
419 Views
Last Modified: 2014-11-12
need a powershell script that looks in an ou to see if ForwardingSMTPAddress is enable
0
Comment
Question by:Jorge Ocampo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Assisted Solution

by:Adam Farage
Adam Farage earned 250 total points
ID: 40427627
I think the easiest way to do this is to turn this into a report..


Get-Mailbox -OrganizationalUnit <enter OU location without brackets> | Select DisplayName, ForwardingSmtpAddress | Export-CSV C:\Forwarding.csv

Open in new window


Open the document in Excel:

C:\Forwarding.csv (or you can simply open excel, but I like typing stuff out)

Open in new window


Click on the Insert tab, and then select "My table has headers". From there filter out the section that says "blank" and pow - there are the users who have a forwarding along with the destination in a nice simple report :)
0
 
LVL 16

Accepted Solution

by:
Joshua Grantom earned 250 total points
ID: 40428384
Or you can just pull a report that only includes users who have a value for ForwardingSMTPAddress.

Get-Mailbox -OrganizationalUnit "OU=MyOU,DC=domain,DC=com" -Filter {ForwardingSmtpAddress -ne $null} | Select Name,ForwardingSmtpAddress | Export-CSV C:\ForwardingEnabled.csv -nti

Open in new window


If the first one doesn't work

Get-Mailbox -OrganizationalUnit "OU=MyOU,DC=domain,DC=com" -Filter {ForwardingSmtpAddress -ne "*"} | Select Name,ForwardingSmtpAddress | Export-CSV C:\ForwardingEnabled.csv -nti

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question