MsExchange Blog Spot Telnet25

August 14, 2013

Exchange 2010 Create Database Script

Filed under: General — telnet25 @ 1:18 pm

If you like to create Exchange 2010 database here is real simple script will help you or your helpdesk to get the work done.

Simply run the script and fallow the directions, enjoy.

#========================================================================
# Created with: NotePad
# Created on:   8/1/2013 9:21 AM
# Created by:   Oz Casey Dedeal
# Organization: ZTEKzone
# Filename:     ZTEKzone_Create_MBDataBase_V2.ps1
#========================================================================

Write-Host `tZTEKzone Create DataBase Script.`n -Fore Red;start-Sleep -Seconds 1
Write-Host `t We will need to mount the DB after creating it.`n -Fore Yellow;start-Sleep -Seconds 1
Write-Host `t  You need to be assigned permissions before you can perform this procedure or procedures.`n -Fore Magenta;start-Sleep -Seconds 1
# This is Where we Provide More Details
$SName = read-host "Enter The Name for DB Server, like ( e1 ) "
$DBName = read-host "Enter The Name for Your Database, like ( db15 ) "
$EDbfp = read-host "Enter The DB Path , like ( E:\DatabaseFiles\MP1\ )"
$Lfp= read-host "Enter Log Path for Recovery , like ( E:\LogFiles\MP1\ )"

New-MailboxDatabase -Name $DBName -Server $SName -EdbFilePath "$EDbfp\$DBName\$DBName.edb" -LogFolderPath "$Lfp\$DBname.logs"

Write-Host `tI will mount the DB now .`n -Fore Yellow;start-Sleep -Seconds 2
Get-MailboxDatabase $DBName | Mount-Database
Write-Host `tHang on I am working on it.`n -Fore Yellow;start-Sleep -Seconds 3

# We are done
Write-Host `tI am done now.`n -Fore Red;start-Sleep -Seconds 1
Write-Host `tUse Get-Help -Examples.`n -Fore Yellow;start-Sleep -Seconds 1
Write-Host `tTo Learn More About PowerShell.`n -Fore Red;start-Sleep -Seconds 1
Write-Host `tUse Get-Help -get-MailBox -Examples.`n -Fore Yellow;start-Sleep -Seconds 1

Get-MailboxDatabase $DBName | Mount-Database

#Write-Host `tI am done now. I will list the databases and provide some information`n -Fore Red;start-Sleep -Seconds 4
#Get-MailboxDatabase -Status | select ServerName,Name,Mounted
Write-Host `tWe are done, we will exist now!!!.`n -Fore Yellow;start-Sleep -Seconds 1

Download the script from here

Respectfully,
Oz Casey, Dedeal ( MVP north America)
MCITP (EMA), MCITP (SA)
MCSE 2003, M+, S+, MCDST
Security+, Project +, Server +
http://smtp25.blogspot.com/ (Blog)
https://telnet25.wordpress.com/ (Blog)

 

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: