periodically Delete all content of particular mailbox

open notepad, add the below command

Export-Mailbox <username> -DeleteContent -confirm: $False

 http://technet.microsoft.com/en-us/library/aa998579(EXCHG.80).aspx

 Save the file as filename.ps1

Open Notepad

C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -psconsolefile "c:\Program Files\Microsoft\Exchange Server\V15\Bin\exshell.psc1" -command "C:\Scripts\filename.ps1

save as export.bat

go to task manager schedule the task to run the batch file 

August 11th, 2015 5:19am

Vishwanath  this will export the as PST but we dont wan to export as pst I am looking some thing 

Get-Mailbox username -delte all content *.* -confirm  

is it possible ? 

Free Windows Admin Tool Kit Click here and download it now
August 11th, 2015 8:08am

Hi,

I understand you want to delete the mailbox content periodically.

On exchange 2013, you can create the retention policy for the mailbox.

To apply one or more retention tags to a mailbox, we can add them to a retention policy and then apply the policy to mailboxes.

More detailed information, please refer to the below link:

https://technet.microsoft.com/en-us/library/dd297955(v=exchg.150).aspx  

Regards,

David           

August 11th, 2015 9:56pm

Hi 

I am looking one power shell script which will run through schedule task and delete all content of particular mailbox .

thanks

Free Windows Admin Tool Kit Click here and download it now
August 12th, 2015 3:16am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics