Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Script to mount exchange 2007 database

Posted on 2016-10-11
4
Medium Priority
?
144 Views
Last Modified: 2016-10-16
Hello Experts

I need a script that I can schedule to mount an Exchange 2007 database (on a Windows 2008  server)
Can you please point me in the right direction.

Thank you

Alex
0
Comment
Question by:Alexandre Michel
[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
  • 2
4 Comments
 
LVL 16

Assisted Solution

by:Todd Nelson
Todd Nelson earned 1000 total points
ID: 41839477
Are you looking for something like this to create a scheduled task to run an Exchange script?

http://www.zerohoursleep.com/2010/04/how-to-run-exchange-ps1-script-as-scheduled-task/

In the PS1, you could have "Mount-Database -Identity "Mailbox Database"".
0
 
LVL 4

Author Comment

by:Alexandre Michel
ID: 41839506
@Todd

That would be step 2 of the project: how to schedule running the script

The 1st step is the actual content of the script... How do I mount an Exchange database using Powershell or other scripting language

Alexandre
0
 
LVL 27

Accepted Solution

by:
MAS earned 1000 total points
ID: 41839627
Hi,
Create a batch file by copying the below command and save as .bat. You can change as per your location
powershell -command "&{C:\scripts\mountdatabase.ps1}"

Open in new window

http://www.makeuseof.com/tag/write-simple-batch-bat-file/

Create a powershell script using the below command and save it
Get-MailboxDatabase -Server SERVERNAME | Mount-Database -Confirm:$False

Open in new window

https://msdn.microsoft.com/en-us/powershell/scripting/core-powershell/ise/how-to-write-and-run-scripts-in-the-windows-powershell-ise?f=255&MSPPError=-2147217396

Create a windows schedule task to run the batch file created above.
http://www.thewindowsclub.com/how-to-schedule-batch-file-run-automatically-windows-7

Thanks
MAS
0
 
LVL 4

Author Comment

by:Alexandre Michel
ID: 41845867
@ MAS

Thanks for that.
At the end I did not try your solution as I found that simple restarting the Exchnage IS service acheived the same result.

Alexandre
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

604 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