Solved

Resetting an exchange mailbox back to it original state.

Posted on 2004-09-07
4
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

This is an explanation of a simple data model to help parse a JSON feed
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

740 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