Hi, @Roger Roger
From the above conversation, I understand that you want to remove a specific user from an in-place hold. From your reply, it is not surprising that your error is to be expected.
The term '******@contoso.com' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
This error message indicates that ******@contoso.com is being interpreted as a command, not a string. To fix this, you need to put ******@contoso.com in quotation marks to make sure it's correctly recognised as a string. However, it is important to note that this command does not meet your initial needs. Therefore, it is not recommended that you use this command.
Remove-CaseHoldPolicy : A parameter cannot be found that matches parameter name 'User'.
According to the official documentation, this error indicates that there is no -User parameter in the Remove-CaseHoldPolicy command. Similarly, the command doesn't meet your need to remove a specific user from the policy.
In order to achieve your initial needs, you can follow these steps:
1.The command used in your initial description is correct. Extract the values in the red box. In this case, there are user1 and user2 in the policy.
2.Use the following command to remove user1:
Set-CaseHoldPolicy -Identity "Policy Name" -RemoveExchangeLocation "user1"
3.Looking at the policy again, only user2 and user1 have been successfully removed.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".