Setting Retention Policy Issues

Welcome Forums General PowerShell Q&A Setting Retention Policy Issues

This topic contains 2 replies, has 2 voices, and was last updated by

4 years, 6 months ago.

  • Author
  • #18924

    Points: 0
    Rank: Member

    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

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

    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

    Points: 60
    Rank: Member

    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

    Points: 0
    Rank: Member

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

The topic ‘Setting Retention Policy Issues’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort