Solved

Exchange Query for Forwarding users

Posted on 2011-02-16
3
1,271 Views
Last Modified: 2012-05-11
Hi,

I have a query that exports users that are NOT having their emails forwards. I need one that shows me which ARE having their emails forwarded, I thought I just needed to add $true in the query instead of $null, but it's not working.


Get-Mailbox -Filter { ForwardingAddress -eq $Null } | Select-Object PrimarySmtpAddress,
    SamAccountName, DisplayName,
    @{n='Department';e={ (Get-User $_.DistinguishedName).Department }} |
  Export-Csv C:\noforward.csv -NoTypeInformation
Get-Mailbox -Filter { ForwardingAddress -eq $Null } | Select-Object PrimarySmtpAddress, 
    SamAccountName, DisplayName,
    @{n='Department';e={ (Get-User $_.DistinguishedName).Department }} | 
  Export-Csv C:\noforward.csv -NoTypeInformation

Open in new window

0
Comment
Question by:Methodman85
3 Comments
 
LVL 3

Accepted Solution

by:
Richard2k4 earned 250 total points
ID: 34909624
have you tried get-mailbox -filter { ForwardingAddress -gt $Null}

0
 
LVL 42

Assisted Solution

by:Amit
Amit earned 250 total points
ID: 34909626
Try This

Get-Mailbox | Where {$_.ForwardingAddress -ne $null} | Select Name, ForwardingAddress, DeliverToMailboxAndForward
0
 
LVL 1

Author Closing Comment

by:Methodman85
ID: 34909692
Thank you good sirs, both worked!
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
To show how to generate a certificate request 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 Servers >> Certificates…

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

26 Experts available now in Live!

Get 1:1 Help Now