Setting Retention Policy Issues

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Mark DiPofi Mark DiPofi 2 years, 2 months ago.

  • Author
    Posts
  • #18924
    Profile photo of Mark DiPofi
    Mark DiPofi
    Participant

    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
    Profile photo of Tim Pringle
    Tim Pringle
    Participant

    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
    Profile photo of Mark DiPofi
    Mark DiPofi
    Participant

    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.