• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 468
  • Last Modified:

Exchange Rules Report

I have an Exchange 2010 SP2 server. I created a rule called "Spam" using the Exchange PowerShell command new-inboxrule for all my users.

Anyone can delete the rule I created using Outlook.

I want to know how to script running a report that will verify that the "Spam" rule exists in each of my users mailbox.

Thanks for your help
0
mmcodefive
Asked:
mmcodefive
  • 4
  • 2
1 Solution
 
suriyaehnopCommented:
Hi,

I believe that you are running on Exchange 2010 SP2 NOT Exchange 2007 SP2 since "New-InboxRule" is cmdlet availble on Exchange 2010 SP2

Managing Inbox Rules in Exchange Server 2010

Refer to link http://www.msexchange.org/articles_tutorials/exchange-server-2010/management-administration/managing-inbox-rules-exchange-server-2010.html
0
 
Exchange_GeekCommented:
New-InboxRule works on Exchange 2010 Read: link

Run a simple cmdlet

Get-Mailbox | Get-InboxRule | where {$_.Name -eq "*Spam*"}

You'll get the entire list of mailboxes that have the rule configured for it.

Regards,
Exchange_Geek
0
 
mmcodefiveAuthor Commented:
I ran that and the only output I am getting is errors when the rule is not found.

The operation couldn't be performed because 'domain.local/Users/test\' couldn't be found.
    + CategoryInfo          : NotSpecified: (:) [Get-InboxRule], ManagementObjectNotFoundException
    + FullyQualifiedErrorId : 7A5308EF,Microsoft.Exchange.Management.RecipientTasks.GetInboxRule

I would like it to output a list of users that have the rule.
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
Exchange_GeekCommented:
Let me try this on my lab tomorrow.

Regards,
Exchange_Geek
0
 
mmcodefiveAuthor Commented:
Exchange_Geek, any update? Thanks for your help
0
 
mmcodefiveAuthor Commented:
This is the script I created. It outputs all the results to a file on the root of C: called results.txt

foreach ($i in (Get-Mailbox -ResultSize unlimited)) { Get-InboxRule -Mailbox $i.DistinguishedName | select $i.name, name | Out-File -append C:\results.txt}
0
 
mmcodefiveAuthor Commented:
I solved my own problem
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now