Solved

i need a powershell command that looks for ForwardingSMTPAddress in OU

Posted on 2014-11-06
2
332 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
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

Are your corporate email signatures appalling?

Is it scary how unprofessional your email signatures look? Do users create their own terrible designs and give themselves stupid job titles? You can make this a lot easier for yourself by choosing an email signature management solution from Exclaimer today.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
In this video we show how to create an Address List 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 Organization >> Ad…
In this video we show how to create an Accepted Domain 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 >> Ac…

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now