question

BartoszFilipczak-6768 avatar image
0 Votes"
BartoszFilipczak-6768 asked KaelYao-MSFT commented

Exclude inactive mailboxes from all org holds

Hi all! We're trying to exclude all inactive mailboxes from all org holds (retention policy) to convert them to temporary (183 days by design) soft-deleted state to allow them to be auto-purged after that time. We created this so far:

$Inactive = Get-Mailbox -InactiveMailboxOnly -Filter "(LitigationHoldEnabled -eq 'false')" # that's correct, we get the correct value in this variable. We want to get inactive AND not under litigation

$Inactive | foreach {Set-Mailbox -Identity $_ -ExcludeFromAllOrgHolds} # that's not correct, it gives "cannot process argument transformation on parameter 'Identity'. Cannot convert value "INACTIVE" to type..."

any ideas how to make the 2nd line work? I'd greatly appreciate that!

office-exchange-online-itpro
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KaelYao-MSFT avatar image
0 Votes"
KaelYao-MSFT answered KaelYao-MSFT commented

Hi @BartoszFilipczak-6768

Please try this command and see if it works for you:

 $Inactive = Get-Mailbox -InactiveMailboxOnly -Filter "(LitigationHoldEnabled -eq 'false')"
 $Inactive | foreach {Set-Mailbox -Identity $Inactive.DistinguishedName -ExcludeFromAllOrgHolds}

If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @BartoszFilipczak-6768

Just checking in to see if above information was helpful.
Please let us know if you would like further assistance.

0 Votes 0 ·

Hi @BartoszFilipczak-6768

I am writing here to confirm with you how thing going now?
Did the above suggestion help with the issue?

0 Votes 0 ·