• RSS
  • Twitter
  • FaceBook

Exchange Server Forums

Forums | Register | Login | My Profile | Inbox | RSS RSS icon | My Subscription | My Forums | Address Book | Member List | Search | FAQ | Ticket List | Log Out

Issue removing managed folder MB policy via script

Users viewing this topic: none

Logged in as: Guest
  Printable Version
All Forums >> [Microsoft Exchange 2007] >> Compliance >> Issue removing managed folder MB policy via script Page: [1]
Login
Message << Older Topic   Newer Topic >>
Issue removing managed folder MB policy via script - 2.Mar.2012 1:55:57 PM   
tfd6412

 

Posts: 119
Joined: 24.Dec.2007
From: Florida
Status: offline
Hey all,

I'm trying to create a script that will assign a Managed Folder Mailbox Policy based on Distribution Group membership. I can assign it just fine. But there is a Distribution Group called "LEGALHOLD" that should not have any policy applied. So if someone who previously had a policy applied, moving them to the LEGALHOLD distribution group should clear that policy. I was told by a colleague to configure like so with the "$null" parameter:

Get-DistributionGroupMember "LEGALHOLD" -ResultSize unlimited | Set-Mailbox -ManagedFolderMailboxPolicy "$null" -ManagedFolderMailboxpolicyAllowed

That will spit out the following error:

Set-Mailbox : Cannot bind parameter 'ManagedFolderMailboxPolicy'. Cannot conve
t value "" to type "Microsoft.Exchange.Configuration.Tasks.MailboxPolicyIdPara
eter". Error: "The parameter value of this type Microsoft.Exchange.Configurati
n.Tasks.MailboxPolicyIdParameter cannot be empty.
Parameter name: identity"
At C:\Scripts\AssignRetentionPolicy\AssignRetentionPolicy.ps1:14 char:104
+ Get-DistributionGroupMember "LEGALHOLD" -ResultSize unlimited | Set-Mailbox
ManagedFolderMailboxPolicy <<<< "$null" -ManagedFolderMailboxPolicyAllowed
+ CategoryInfo : InvalidArgument: (:) [Set-Mailbox], ParameterBin
dingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Exchang
e.Management.RecipientTasks.SetMailbox


Obviously $null doesn't work. Any suggestions?

< Message edited by tfd6412 -- 2.Mar.2012 1:57:21 PM >
Post #: 1
RE: Issue removing managed folder MB policy via script - 2.Mar.2012 2:04:38 PM   
tfd6412

 

Posts: 119
Joined: 24.Dec.2007
From: Florida
Status: offline
It appears the quotes around "$null" are the problem.

Corrected:

Get-DistributionGroupMember "LEGALHOLD" -ResultSize unlimited | Set-Mailbox -ManagedFolderMailboxPolicy $null -ManagedFolderMailboxPolicyAllowed

Cheers!

(in reply to tfd6412)
Post #: 2

Page:   [1] << Older Topic    Newer Topic >>
All Forums >> [Microsoft Exchange 2007] >> Compliance >> Issue removing managed folder MB policy via script Page: [1]
Jump to:

New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Follow TechGenix on Twitter