Created
November 14, 2015 12:38
-
-
Save maestropanel2/5e065042939b2e5ed875 to your computer and use it in GitHub Desktop.
Exchange Server 2013 Restore Recovery Mailbox Database Script
This file contains 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
<# | |
.SYNOPSIS | |
Bu script Recovery Mailbox Database'indeki mailbox'lara göre yeni kullanıcı oluşturur ve Restore isteği gönderir. | |
.DESCRIPTION | |
Başka bir sunucu üzerinden kurtarılmış ve yeni bir sunucuya Mount edilmiş Mailbox Database içindeki kullanıcı tipindeki Mailbox'ları listeler ve bunlara göre aktif Veritabanı üzerinde kullanıcılar oluşturur. Oluşturulan kullanıcılar için eski veritabanından Restore isteği gönderir. | |
.NOTES | |
File Name : ResoteRecoveryDB.ps1 | |
Author : Oğuzhan YILMAZ (oguzhan@maestropanel.com) | |
Prerequisite : Exchange Server 2013 | |
.LINK | |
http://wiki.maestropanel.com | |
#> | |
$RecoveryDatabaseName = "RecoveryDB" #Veritabanının İsmi | |
$TempPassword = Read-Host "makara24!" -AsSecureString #Geçici parola, Kullanıcı açmak için | |
$UPNSuffix = "salla.com"; #Sunucu üzerindeki geçerli suffix | |
foreach($ritem in Get-MailboxStatistics -Database $RecoveryDatabaseName | ?{($_.DisplayName -notlike "*HealthMailbox*") -AND ($_.DisplayName -notlike "*Microsoft*") -AND ($_.DisplayName -notlike "*SystemMailbox*") -AND ($_.DisplayName -ne "Administrator")}) { | |
New-Mailbox -DisplayName $ritem.DisplayName -Name $ritem.DisplayName -Password $TempPassword -UserPrincipalName "$($ritem.Identity)@$($UPNSuffix)" | |
New-MailboxRestoreRequest -SourceDatabase RecoveryDB -SourceStoreMailbox $ritem.Identity -TargetMailbox $ritem.DisplayName -AllowLegacyDNMismatch | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment