Created
August 13, 2014 07:25
-
-
Save trondhindenes/948ee0aa0ef99b5ee1d7 to your computer and use it in GitHub Desktop.
GenerateDBs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Folders = get-childitem *db* -path "D:\MDB" -Recurse | |
foreach ($folder in $folders) | |
{ | |
$DBName = $folder.Name | |
$ExchangeServer = $DBName.split("-")[0] | |
$LogFolderPath = $folder.Fullname.Replace("DB","LOG") | |
$edbfilepath = "$($folder.FullName)\$DBName.edb" | |
if (!(get-mailboxdatabase $DBName -erroraction 0)) | |
{ | |
New-mailboxdatabase -server $ExchangeServer -name $dbname -LogFolderPath $LogFolderPath | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment