Solved

Resetting an exchange mailbox back to it original state.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
endX challenge 2 64
strDist challenge 35 97
firstswap challenge 20 68
how to use laptop or pad camera in vb.net windows application 2 55
This is an explanation of a simple data model to help parse a JSON feed
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

863 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

26 Experts available now in Live!

Get 1:1 Help Now