Link to home
Start Free TrialLog in
Avatar of Armen Minasyan
Armen MinasyanFlag for United States of America

asked on

Exchange 2010 SP1 New-InboxRule issue

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
Avatar of Akhater
Akhater
Flag of Lebanon image

please try this

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

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Akhater
Akhater
Flag of Lebanon image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
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 ?
OK, Thanks much for your help!!!