开发者

DeleteContents from mailbox with no confirmation (exchange 2010 and powershell)

开发者 https://www.devze.com 2023-03-04 17:44 出处:网络
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.

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" -DeleteCont开发者_JAVA技巧ent -Confirm:$false


The way to stop prompting is to use the -Force parameter (if the cmdlet supports it).

Setting -Confirm to $false just means "prompt me if you need to." Setting -Confirm to $true means "prompt me every time."


There seems to be a syntax error -confirm like -DeleteContent is a SwitchParameter this means that you just have to omit it.

Search-Mailbox -id "UserName" -DeleteContent 


Simple thing just go through /Library/Mail/v2/MailData and delete the files with names Envelope then all the contents will be deleted from Mail App

0

精彩评论

暂无评论...
验证码 换一张
取 消