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.