I use the following command to delete the contents of a mailbox, but it still prompts me to confirm. Is there a way to not prompt me.
Search-Mailbox -id "UserName" -DeleteContent -Confirm:$false
The way to stop prompting is to use the
-Force parameter (if the cmdlet supports it).
$false just means “prompt me if you need to.” Setting
$true means “prompt me every time.”