Setting Retention Policy Issues

This topic contains 2 replies, has 2 voices, and was last updated by  Mark DiPofi 3 years, 8 months ago.

  • Author
  • #18924

    Mark DiPofi

    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.

  • #18936

    Tim Pringle

    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?

  • #18938

    Mark DiPofi

    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).

You must be logged in to reply to this topic.