Solved

Resetting an exchange mailbox back to it original state.

Posted on 2004-09-07
4
255 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Add mobile access to browser application 3 131
copyEvens challenge 6 63
word0 challenge 3 58
Magic Software info 18 105
RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now