Script to mount exchange 2007 database

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
LVL 4
Alexandre MichelManager; IT ConsultantAsked:
Who is Participating?
 
MAS (MVE)Connect With a Mentor Technical Department HeadCommented:
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
 
Todd NelsonConnect With a Mentor Systems EngineerCommented:
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
 
Alexandre MichelManager; IT ConsultantAuthor Commented:
@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
 
Alexandre MichelManager; IT ConsultantAuthor Commented:
@ 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.