[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Exchange 2010 SP1 New-InboxRule issue

Posted on 2011-03-11
6
Medium Priority
?
2,842 Views
Last Modified: 2012-05-11
Hi guys,

Migrated to Exchange 2010 and need to create new Outlook Server-Side rule to move the tagged messages into Subfolder.

Successfully created rule to implement for individual users:

New-InboxRule "eBrochure" -Mailbox "AVM" -SubjectContainsWords "eBrochure:" -MoveToFolder "AVM:\eBrochure"

But when I'm trying to apply it to all users on the server I'm getting error. Here is the code:


$mailboxes = Get-Mailbox -Server EX2KMBOX
$mailboxes | foreach { New-InboxRule "eBrochure" -Mailbox $_.Name -SubjectContainsWords "eBrochure:" -MoveToFolder "\eBrochure"}


Error is:

The specified mailbox "\eBrochure" doesn't exist.
    + CategoryInfo          : NotSpecified: (0:Int32) [New-InboxRule], ManagementObjectNotFoundException
    + FullyQualifiedErrorId : F38C5D83,Microsoft.Exchange.Management.RecipientTasks.NewInboxRule

The specified mailbox "\eBrochure" doesn't exist.
    + CategoryInfo          : NotSpecified: (0:Int32) [New-InboxRule], ManagementObjectNotFoundException
    + FullyQualifiedErrorId : F38C5D83,Microsoft.Exchange.Management.RecipientTasks.NewInboxRule


Please advise what is wrong in my code.

Also, I craeted a custom managed folder in Exchange 2010. How to make it visible in user's Outlook's set of folders?

Thank you in advance!

Armen
0
Comment
Question by:Armen Minasyan
[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
  • 3
6 Comments
 
LVL 49

Expert Comment

by:Akhater
ID: 35110656
please try this

$mailboxes = Get-Mailbox -Server EX2KMBOX
$mailboxes | foreach { New-InboxRule -name "eBrochure" -Mailbox $_.Alias -SubjectContainsWords "eBrochure:" -MoveToFolder "$_.Alias:\eBrochure"}
0
 

Author Comment

by:Armen Minasyan
ID: 35110718
Just tried this. More promising but still getting multiple error on every box:

The specified mailbox "Dieter Meyer.Alias" doesn't exist.
    + CategoryInfo          : NotSpecified: (0:Int32) [New-InboxRule], ManagementObjectNotFoundException
    + FullyQualifiedErrorId : F489F465,Microsoft.Exchange.Management.RecipientTasks.NewInboxRule
0
 
LVL 49

Accepted Solution

by:
Akhater earned 2000 total points
ID: 35110760
oki now this

$mailboxes = Get-Mailbox -Server EX2KMBOX
$mailboxes | foreach { New-InboxRule -name "eBrochure" -Mailbox $($_.Alias) -SubjectContainsWords "eBrochure:" -MoveToFolder "$($_.Alias):\eBrochure"}
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

Author Comment

by:Armen Minasyan
ID: 35110817
Akhater!

Thanks much!!!! PERFECT!!!! I'm getting errors only on the mailboxes which don't have the folders on their mailboxes. So, question is to how to create subfolders first? Is it something you can do?

Here what I tried:

$mailboxes = Get-Mailbox -Server EX2KMBOX
$mailboxes | foreach { New-ManagedFolder -name $($_.Alias) -FolderName "$($_.Alias):\eBrochure" -StorageQuota '50Mb' -Comment 'Messages in this folder are retained for 2 Weeks' -MustDisplayComment $true }


But it is creating a lot of Managed folders such DMR\Ebrochures
0
 
LVL 49

Expert Comment

by:Akhater
ID: 35110891
managed folders are not per user it should be enough to create one managed folder. I am afraid I am not very familiar with managed folders so I won't be able to help on this one sorry...

Maybe try another question ?
0
 

Author Comment

by:Armen Minasyan
ID: 35110899
OK, Thanks much for your help!!!
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.

Question has a verified solution.

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

I don't pretend to be an expert at this, but I have found a few things that are useful. I hope that sharing them here will help others, so they will not have to face some rather hard choices. Since I felt this to be a topic of enough importance and…
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 video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses

649 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