Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Exchange Query for Forwarding users

Posted on 2011-02-16
3
Medium Priority
?
1,291 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
[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
3 Comments
 
LVL 3

Accepted Solution

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

0
 
LVL 44

Assisted Solution

by:Amit
Amit earned 1000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

New style of hardware planning for Microsoft Exchange server.
Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
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 …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Suggested Courses

688 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