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!