Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Resetting an exchange mailbox back to it original state.

Posted on 2004-09-07
4
Medium Priority
?
274 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 500 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Simple Linear Regression
Screencast - Getting to Know the Pipeline

916 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