Solved

Exchange Query for Forwarding users

Posted on 2011-02-16
3
1,283 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 43

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

Technology Partners: 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

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

713 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