Super! Danke!
Beiträge von sut
-
-
Hallo,
eventuell hat ja noch jemand Verwendung für das Backup Skript:
Zitat# Aufruf in Aufgabenplanung
# C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -version 2.0 -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto;C:\Exchange_Mailbox_Backup\exchange_backup.ps1"
# In Aufgabenplanung unbedingt "Mit höchsten Privilegien ausführen" setzen
# Set Debug Eventlog Level
# Set-EventLogLevel -Identity "MSExchange CmdletLogs\General" -Level Expert
# Set-EventLogLevel -Identity "MSExchange Mailbox Replication\Service" -Level Expert# Set-EventLogLevel -Identity "MSExchange CmdletLogs\General" -Level Lowest
# Set-EventLogLevel -Identity "MSExchange Mailbox Replication\Service" -Level Lowest# Timeout Error
# Microsoft.Exchange.MailboxReplicationService.TimeoutErrorTransientException: Timeout beim Aufruf von 'net.tcp://myserver/Microsoft.Exchange.MailboxReplicationService myserver (14.3.151.0 caps:07)'. Fehlerdetails: Dieser an net.tcp://myserver/Microsoft.Exchange.MailboxReplicationService gesendete Anforderungsvorgang hat innerhalb des konfigurierten Zeitlimits (00:01:00) keine Antwort empfangen.$ReportShare = "\\psfile003\exchangeBackup"
# Create Backup Folder:
$BackupFolder = "\\psfile003\exchangeBackup" + (Get-Date -uformat %Y%m%d)if( -not(Test-Path -Path $BackupFolder))
{
md $BackupFolder
Write-Output $BackupFolder + " created"
}# Batchname
$BatchName = (Get-Date -uformat %Y%m%d)
Write-Output $BatchName# Collect all Mailboxes
$i=0
$sl = New-Object Collections.SortedListGet-Mailbox -Filter {RecipientTypeDetails -eq "UserMailbox"} | ForEach-Object {
$sl.add($i,$_.alias)
# Write-Output $i
# Write-Output $sl[$i]
# Write-Output $_.name -foregroundcolor cyan
$i++
}# debug info
Get-Mailbox -Filter {RecipientTypeDetails -eq "UserMailbox"} | Out-File -Append -FilePath "$($ReportShare)\$($BatchName)_Debug.txt"###################
# Export Mailboxes
#################### debug info
"sl.count:" | Out-File -Append -FilePath "$($ReportShare)\$($BatchName)_Debug.txt"
$sl.count | Out-File -Append -FilePath "$($ReportShare)\$($BatchName)_Debug.txt"# New-MailboxExportRequest -Mailbox alan.reid -FilePath \\esp-ho-ex2010a\pst\alan.reid.pst
# Write-Output $sl[37]
for ($x=0;$x -lt $sl.count ;$x++) {
# Write-Output $sl[$x]
# Batchname ist zur identifizierung der gesamten gruppe
#$command = "New-MailboxExportRequest -BatchName " + $BatchName + " -Mailbox " + $sl[37] + " -FilePath " + $BackupFolder + "" + $sl[37] + ".pst"
$command = "New-MailboxExportRequest –Verbose -BadItemLimit 5 -BatchName '" + $BatchName + "' -Mailbox '" + $sl[$x] + "' -FilePath '" + $BackupFolder + "" + $sl[$x] + ".pst'"
Write-Output $command
$output = Invoke-Expression $command
# Invoke-Command -ScriptBlock $command
$command | Out-File -Append -FilePath "$($ReportShare)\$($BatchName)_Debug.txt"
$output | Out-File -Append -FilePath "$($ReportShare)\$($BatchName)_Debug.txt"sleep 10
# Wait for single mailbox export request to complete
# get all Requests: Get-MailboxExportRequest -BatchName 20130826
while ((Get-MailboxExportRequest -BatchName $BatchName | Where {$_.Status -eq "Queued" -or $_.Status -eq "InProgress"}))
{
Write-Output "Waiting for completion..."
"Waiting for completion..." | Out-File -Append -FilePath "$($ReportShare)\$($BatchName)_Debug.txt"
sleep 90
}
}# debug info
"All Jobs Done" | Out-File -Append -FilePath "$($ReportShare)\$($BatchName)_Debug.txt"# Wait for mailbox export requests to complete
# get all Requests: Get-MailboxExportRequest -BatchName 20130826
while ((Get-MailboxExportRequest -BatchName $BatchName | Where {$_.Status -eq "Queued" -or $_.Status -eq "InProgress"}))
{
Write-Output "Waiting for completion..."
sleep 5
}# Write reports if required
if ($ReportShare)
{
Write-Output "Writing reports to $($ReportShare)"
$Completed = Get-MailboxExportRequest -BatchName $BatchName | Where {$_.Status -eq "Completed"} | Get-MailboxExportRequestStatistics | Format-List
if ($Completed) {
$Completed | Out-File -FilePath "$($ReportShare)\$($BatchName)_Completed.txt"
}
$Incomplete = Get-MailboxExportRequest -BatchName $BatchName | Where {$_.Status -ne "Completed"} | Get-MailboxExportRequestStatistics | Format-List
if ($Incomplete) {
$Incomplete | Out-File -FilePath "$($ReportShare)\$($BatchName)_Incomplete_Report.txt"
}
}# Remove Requests
Write-Output "Removing requests created as part of batch '$($BatchName)'"
Get-MailboxExportRequest -BatchName $BatchName | Remove-MailboxExportRequest -Confirm:$false
# remove all:
# Get-MailboxExportRequest | Remove-MailboxExportRequest -Confirm:$falseLeider gehen die Backslash verloren wenn ichs als code einfüge. Daher als Zitat ohne die Einrückungen.
-
Hallo,
das funktioniert nun alles super!
Bei einem Postfach habe ich beim ersten aufruf eine Timeout Exception bekommen:CodeMicrosoft.Exchange.MailboxReplicationService.TimeoutErrorTransientException: Timeout beim Aufruf von 'net.tcp://myserver/Microsoft.Exchange.MailboxReplicationService myserver (14.3.151.0 caps:07)'. Fehlerdetails: Dieser an net.tcp://myserver/Microsoft.Exchange.MailboxReplicationService gesendete Anforderungsvorgang hat innerhalb des konfigurierten Zeitlimits (00:01:00) keine Antwort empfangen.
Zufällig eine Ahnung wo man das Timeout raufdrehen kann? In der MSExchangeMailboxReplication.exe.config gibt es nur den Eintrag
mit einer Zeit von 00:01:00. Wo könnte das sonst zu finden sein?
lg
sut -
Hallo,
habe gerade das Skript nochmal gestartet. Das mit den "höchsten Privilegien" scheint anscheinend zu helfen! Ansonsten lässt er das anscheinend nicht im Admin Mode laufen.
Ich schau mal obs jetzt ganz durchläuft. Wenn ja poste ich das Skript mal hier mit einer Anleitung. Eventuell hilfts ja anderen Admins.
Danke!!
lg
sut -
Hallo,
ich kniffle jetzt schon ewig an einem Problem und komm nicht mehr weiter. Ich habe ein Exchange Mailbox Backup Script gebastelt. Wenn das Script in der Powershell console aufgerufen wird bspw mit:
ZitatC:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\V14\bin\ExShell.psc1" -Command ". 'C:\Exchange_Mailbox_Backup\exchange_backup.ps1'"
funktioniert das Backup der Mailboxen.
Wenn nun das Backup über die Aufgabenplanung automatisiert gestartet werden soll funktioniert es leider nicht. Als Aktion ist Programm starten ausgewählt:
ZitatProgramm/Script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
ZitatArgumente: -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\V14\bin\ExShell.psc1" -Command ". 'C:\Exchange_Mailbox_Backup\exchange_backup.ps1'"
Komischerweise funktioniert soweit alles bis zum eigentlichen Backupaufruf. Der Backupaufruf sieht bspw so aus:
Zitat
$command = "New-MailboxExportRequest –Verbose -BadItemLimit 5 -BatchName '" + $BatchName + "' -Mailbox '" + $sl[$x] + "' -FilePath '" + $BackupFolder + "" + $sl[$x] + ".pst'"# command: New-MailboxExportRequest –Verbose -BadItemLimit 5 -BatchName 20140212 -Mailbox j.tester -FilePath \\psfile003\exchangeBackup\20140212\j.tester.pst
$output = Invoke-Expression $command
$output ist leer.
Als Fehlermeldung steht im Eventlog:
Zitat
#New-MailboxExportRequest
# {Verbose=True, BadItemLimit=5, BatchName=20140212, Mailbox=j.tester, FilePath=\\psfile003\exchangeBackup\20140212\j.tester.pst}
# graz.coplanner.com/Users/Hans Ludwig
# Microsoft.Exchange.MailboxReplicationService.NoMRSAvailableTransientException: Es sind keine Server verfügbar, die den Microsoft Exchange-Postfachreplikationsdienst ausführen. bei Microsoft.Exchange.MailboxReplicationService.MailboxReplicationServiceClient.Create(ADSystemConfigurationSession session, MRSCapabilities requiredCapability, Guid mdbGuid, List`1 unreachableMrsServers) bei Microsoft.Exchange.Management.RecipientTasks.NewRequest`1.InitializeMRSClient() bei Microsoft.Exchange.Management.RecipientTasks.NewRequest`1.InternalValidate() bei Microsoft.Exchange.Management.RecipientTasks.NewMailboxExportRequest.InternalValidate() bei Microsoft.Exchange.Configuration.Tasks.Task.ProcessRecord()
# ServerTransientWas passt bei dem Aufruf nicht? Zuvor hole ich mit
alle Mailboxen. Das funktioniert problemlos. Auch ein
funktioniert nicht.
Für Hilfe wäre ich sehr dankbar!
lg
sut