Solved

i need a powershell command that looks for ForwardingSMTPAddress in OU

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
In this video we show how to create a User Mailbox 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 Recipients >> Mailb…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

863 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