Author Posts

September 18, 2014 at 11:10 am

I am able to use the following command to set a mailbox retention to $null (Example 1:). However when I try to do a bulk set (Example 2) the command executes but it does not set the Retention Policy to $NULL. Instead it displays the following on the screen

. [b] WARNING: The command completed successfully but no settings of "user name' have been modified[/b]

Example 1
Set-Mailbox John -RetentionPolicy $Null

Example 2
$UserMailboxes = Get-Mailbox -Filter {(RecipientTypeDetails -eq 'UserMailbox')} $UserMailboxes | Set-Mailbox –RetentionPolicy $Null

Any advise as to why it might not work in bulk mode or something wrong with the syntax.

September 19, 2014 at 12:35 am

Hey Marl,

At first glance, just looks like you a new line.

Instead of : $UserMailboxes = Get-Mailbox -Filter {(RecipientTypeDetails -eq 'UserMailbox')} $UserMailboxes | Set-Mailbox –RetentionPolicy $Null

Use –
$UserMailboxes = Get-Mailbox -Filter {(RecipientTypeDetails -eq 'UserMailbox')}
$UserMailboxes | Set-Mailbox –RetentionPolicy $Null

Or Alternatively –

Get-Mailbox -Filter {(RecipientTypeDetails -eq 'UserMailbox')} | Set-Mailbox –RetentionPolicy $Null

Can you try that?

September 19, 2014 at 4:41 am

Thank you for the information. I checked everything is morning and all the retention policies were set.

I did not get a chance to run your script but it does look correct from my knowledge of powershell.

FYI: As I was writing this response to you I had MS call me and informed me that the error message was normal. They said in the backend the changes were made and there was nothing else to change.

I guess the Exchange GUI was not displaying it correctly (mostly a timing issue).