Solved

Batch file to unmount and remount exchange information store

Posted on 2009-05-06
7
2,373 Views
Last Modified: 2013-11-10
Hello everyone!
We need to create a Batch File to Copy the Stores to to one of our network storage servers every 7 Days
-Example-
sat.bat   Run Every Saturday at 1AM
======
 
service dismount Store
Copy priv1.edb  priv1.stm  pub1.edb pub1.stm to \\networkserver
mount store
Done

I believe everythings pretty straight forward except the dismount and remount of the info store. Can someone help me with a bat file that acheives this? Thanks a ton!
0
Comment
Question by:Abacus IT
  • 4
  • 2
7 Comments
 
LVL 2

Accepted Solution

by:
Gregdo earned 125 total points
ID: 24317596
The following works with MS Exchange Server 2003

Stop the information store:
net stop "Microsoft Exchange Information Store"

Start the information store:
net stop "Microsoft Exchange Information Store"

Just in case you're interested, you can stop other services as well:
net stop "Microsoft Exchange Information Store"
net stop "Microsoft Exchange MTA Stacks"
net stop "Microsoft Exchange Management"
net stop "Microsoft Exchange System Attendant"
0
 
LVL 2

Expert Comment

by:Gregdo
ID: 24317616
Oops, I messed up the restart the service code.  It should be:

net start "Microsoft Exchange Information Store"
0
 
LVL 2

Expert Comment

by:Gregdo
ID: 24317813
For a complete batch file, see the attached code.  To schedule it to run on Saturday at 1:00am, use the Windows Scheduler:  Start / Control Panel / Scheduled Tasks / Add Scheduled Task.


net stop "Microsoft Exchange Information Store"

copy priv1.edb \\networkserver\SomeShare

copy priv1.stm \\networkserver\SomeShare

copy pub1.edb \\networkserver\SomeShare

copy pub1.stm \\networkserver\SomeShare

net start "Microsoft Exchange Information Store"

Open in new window

0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 65

Expert Comment

by:Mestha
ID: 24320214
Are you doing regular backups of Exchange? If not then the system that you are doing is not a valid backup procedure. You need to use an Exchange aware backup application.

Simon.
0
 
LVL 2

Expert Comment

by:Gregdo
ID: 24320666
As @Mestha says, you still need to do a backup using an Exchange aware backup program.  The reason being that Exchange creates log files in case anything goes wrong.  These log files would allow you to restore an old Exchange database and then roll forward using the transaction logs.  When you do a backup, these log files are removed as they are no longer needed.  If you don't do a backup, then these log files keep accumulating and will eventually fill your disk.

An option for an Exchange aware backup is NTBackup (comes as part of Windows).  You would be better off to schedure it to run every week and it can save it's backup to a directory on your network server.
0
 
LVL 1

Author Comment

by:Abacus IT
ID: 24326442
thanks we are using an Exchange aware backup program. My boss wants to copy the edb and stm's as well. Thanks, for the script. I will try it out!
0
 
LVL 65

Expert Comment

by:Mestha
ID: 24327555
The raw files are close to useless. As soon as new data comes in you will be unable to use them. Exchange is designed to be managed in a certain way, and that includes leaving it running 24/7 and backing it up with an Exchange aware application. Copying of the files is not something it is designed to do.

Simon.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

757 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

19 Experts available now in Live!

Get 1:1 Help Now