Solved

Resetting an exchange mailbox back to it original state.

Posted on 2004-09-07
4
264 Views
Last Modified: 2010-04-17
We have a need to be able to delete a specific users email and folders on an exchange 5.5 server. The reason for this is that the users are part of a training suite and every 2 weeks or so we need to set the accounts back to the original state. We do not want to remove the mail box and recreate it as this will pose replication issues on the other exchange server. But we want to remove all inbox item and sent mails plus any additional folders creates.

We would prefer this all to be done through a web interface so hopefully some vbscript can do it?
0
Comment
Question by:counterfitninja
4 Comments
 
LVL 10

Accepted Solution

by:
Kavar earned 125 total points
ID: 11997169
What you are asking for is actually a bit harder than it sounds,
I can think of a few things that *might* work depending on the client this script is running on
This script attempts to remove *ALL* mapi folders off the root, then the next time the client starts it will see that
those folders don't exist so it will recreate them.

The problem with this method is things like rules, reminders and freebusy information is not addressed, depending on your environment and how many times you wipe a mailbox, this may never become a problem so....

if you are using exchange client or outlook98 this will work (depending on the outlook 98 version it may not...)

Lastly you will need to create a profile pointed to the target mailbox, name the profile something and replace the "<profile name>" with the name of the profile you selected

'*********** Begin Script **************
dim cdo
set cdo=createobject("mapi.session")
dim root,store
cdo.logon "<profile name>",,true,true
for each store in cdo.infostores
if instr(1,store.name,"mailbox",1)>0 then
    exit for
end if
Set root=store.rootfolder
For Each subfolder In root.folders
  subfolder.delete
next
'************* End Script  ****************

Lets see if this does what you want before we make this rediculoulsy complex
0
 

Author Comment

by:counterfitninja
ID: 11997273
I will give this a go first too see if does what we require. It may be a few days so dont expect and answer right away.

Thanks for the prompt response. :-)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about a problem I had getting the GPS LocationListener working.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question