Best of Blogs. In meinen Blog veröffentliche alle Lösungen für Probleme mit denen ich selbst zu tun gehabt habe. Die meisten Beiträge sind von anderen Blogs oder Webseiten kopiert.
Mittwoch, 25. Januar 2012
Massenexport aus Exchange-Datenbank in PST-Dateien
Seit Exchange 2010 SP1 gibt es in der Powershell ein “New-MailboxExportRequest” cmdlet. Hiermit können einzelne Postfächer in PST-Dateien exportiert werden. Die PST-Datei kann derzeit nur auf UNC-Pfaden (“\\Server\Share\user.pst") abgelegt werden.
Aber der Reihe nach: Zuerst muss der Administrator sich das Recht zuweisen überhaupt exportieren zu dürfen (Admin-Gruppen müssen mit der Option "-Group” angegeben werden):
New-ManagementRoleAssignment –Role “mailbox import export” –User “SBSAdmin”
Nach dem “New-ManagementRoleAssignment” cmdlet muss die Exchange-Management Shell geschlossen, und als Administrator wieder gestartet werden.
Um nun das Postfach von “Heinz Meyer” zu exportieren genügt der Befehl:
New-MailboxExportRequest –Mailbox Heinz.Meyer –FilePath “\\<servername>\Sharename\Heinz.Meyer.pst”
damit wird die Exportanforderung in Warteschlange gestellt, und in der Regel direkt abgearbeitet. Kontrollieren kann man dies mit dem Befehl (Status = Completed):
Get-MailboxExportRequest
Damit die Exportanforderungen nicht bis zum Ende der Menschheit auftauchen können fertige Anforderungen auch gelöscht werden:
Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest
Das ganze lässt sich per “Aufgabenplanung” automatisieren, so um z.Bsp. wöchentlich oder monatlich einen Export aller Postfächer zu erstellen. Dazu wird ein PowerShell-Skript erstellt, z.Bsp. “%windir%\MailBoxExport.ps1”. Inhalt der Datei:
$Export = get-mailbox; $Export | %{$_|New-MailboxExportRequest -FilePath \\SRVBACKUP\PST$\$($_.alias).pst}
Die soeben erstellte Datei (MailBoxExport.ps1) kann nun per CMD mit folgendem Inhalt aufgerufen werden:
powershell.exe -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto ; %windir%\MailBoxExport.ps1"
exit
Die so erstellten PST-Dateien müssen besonders geschützt werden, da Jeder, der Zugriff darauf hat, diese direkt importieren und somit lesen kann. Generell sollte bei solch einem Export-Vorgang vorher festgelegt werden wer wie wann auf die PST zugreifen kann, damit auch alles rechtskonform geschieht. Evtl. ist der Betriebsrat mit hinzuzuziehen.
Regelmäßig sollten dann noch die Exportanforderungen bereinigt werden – hierzu wieder ein PowerShell-Skript erstellen – %windir%\ExportRequestEntfernen.ps1 – Inhalt:
$ConfirmPreference="none"
Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest
Aufruf per CMD mit folgendem Inhalt:
powershell.exe -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto ; %windir%\ExportRequestEntfernen.ps1"
exit
So kann dann (z.Bsp. monatlich) aufgeräumt werden.
Alles ohne Garantie – alle Skripte vorher in einer Testumgebung testen!
Montag, 2. Januar 2012
Outlook Add-in Sicherung für Persönliche Ordner herunterladen [pfbackup.exe]
Mit dem Download zur Sicherung für Persönliche Ordner werden in Outlook 2000, Outlook 2002, Outlook 2003, Outlook 2007 sowie in Outlook 2010 in regelmäßigen Abständen Sicherungskopien Ihrer Outlook PST-Dateien erstellt, wodurch eine problemlose Sicherung Ihrer Outlook-Ordner gewährleistet wird.
Das Outlook Add-in - Sicherung für Persönliche Ordner steht im Microsoft Download Center zum kostenlosen Download zur Verfügung:
Outlook Add-in - Sicherung für Persönliche Ordner herunterladen
Mit dem Download werden in Outlook in regelmäßigen Abständen Sicherungskopien Ihrer PST-Dateien erstellt.
http://www.microsoft.com/downloads/details.aspx?FamilyID=8b081f3a-b7d0-4b16-b8af-5a6322f4fd01&DisplayLang=de
Download -> pfbackup.exe
Das Feature "Sicherung für Persönliche Ordner" erleichtert und beschleunigt die Sicherung von Informationen in Microsoft Outlook. Dabei werden in Microsoft Outlook 2000, Microsoft Outlook 2002, Microsoft Office Outlook 2003, Microsoft Office Outlook 2007 sowie in Microsoft Outlook 2010 in regelmäßigen Abständen Sicherungskopien Ihrer PST-Dateien erstellt, wodurch eine problemlose Sicherung Ihrer Outlook-Ordner gewährleistet wird. Durch die Sicherung für Persönliche Ordner können Sie auswählen, welche PST-Dateien gesichert und in welchen Zeitabständen Sicherungskopien erstellt werden sollen.
Montag, 16. Mai 2011
Export PST bei Exchange 2010 SP1
Rechte vergeben
Mit Exchange 2010 SP1 können wir beim Export nur noch einen UNC Share benutzen, dieser kann aber auch auf die lokale Platte zeigen und einfach “\\localhost\d$\pst” lauten. Sollte es aber beim Export Probleme geben, muss das Verzeichnis Lese/Schreib Rechte für die Gruppe “Exchange Trusted Subsystem” besitzen.
Zusätzlich müssen wir dem Admin User der den Export durchführt auch die Rechte zum exportieren geben, dazu starten wir die Powershell am Exchange Server und setzen folgendes Kommando ab
New-ManagmentRoleAssignment –Role “Mailbox Import Export” –User Springfield\Administrator
Export einer Mailbox
Fangen wir mal klein an, und exportieren ein einzelnes Postfach um einmal das neue CMDlet kennen zu lernen. Im Beispiel exportiere ich das Postfach unseres Admin auf das Laufwerk D, in den Ordner PST.
New-MailboxExportRequest -Mailbox Administrator –FilePath “\\localhost\d$\pst\Admin.pst
Wir bekommen also die Meldung das der Export in die Warteschlange geschoben wurde, tja was nun? Man kann die aktuelle Export Warteschlange anzeigen lassen und kontrollieren welche Postfächer bereits erledigt sind.
Get-MailboxExportRequest
Wir sehen das das Admin Postfach den Status “InProgress” hat, also wird es gerade exportiert,nach ein paar Minuten sollte das Postfach fertig sein und folgende zeigen.
Unser Export hat den Status “Completed” somit ist der Export abgeschlossen. Wenn ihr jetzt ein paar Postfächer exportiert, wird die Liste immer weiter wachsen, auch wenn der Export bereits erledigt ist, wird der Eintrag nicht gelöscht, dazu gibt es ein einfach Kommando, damit die Queue wieder geleert wird, damit können auch Exporte abgebrochen werden, also Vorsicht.
Get-MailboxExportRequest | Remove-MailboxExportRequest
[adrotate group="3"]
Massen-Export als Task
Jetzt kommen wir zum spannenden Teil, oben habe ich euch die Basics gezeigt, jetzt kommen wir zu dem Punkt, der euch alle interessiert. Wir kann ich alle Postfächer auf einem Exchange Server 2010 mit SP1 als Task automatisiert exportieren? Zuerst einmal das Kommando das wir benötigen um alle Postfächer als PST zu exportieren.
(Get-Mailbox) | foreach {New-MailboxExportRequest –Mailbox $_.alias –FilePath “\\localhost\d$\pst\$_.pst”}
Danach sollte sich die Queue wie oben füllen. Der Export dauert bei mir rund 1 Stunde mit ca. 20GB. Es gibt auf dem Blog von StevieG eine andere Möglichkeit, die aber bei mir nicht funktioniert hat, somit habe ich mir das hier selber zusammengebaut, was für mich als Nicht-Programmierer nicht ganz so einfach war. Zum Schluss müssen wir das ganze jetzt noch automatisieren, wobei hier ein paar Ding zu beachten sind.
Wir müssen die Queue leeren, ich möchte vor jedem Export die alten PST Dateien löschen und der Export soll laufen. Das sollte mit diesen 3 Kommandos erledigt sein.
Get-ChildItem d:\pst\ -include *.pst -recurse | foreach ($_) {Remove-Item $_.fullname}
Get-MailboxExportRequest | Remove-MailboxExportRequest -confirm:$false
(Get-Mailbox) | foreach {New-MailboxExportRequest -Mailbox $_.alias -FilePath \\localhost\d$\pst\$_.pst}
[adrotate group="3"]
Das ganze jetzt noch an eure Umgebung anpassen, also die Verzeichnisse ändern, und ab damit in eine PS1 Datei, das ganze wird dann per Batchfile aufgerufen, welches wir in den TaskPlaner hängen, und schon läuft der PST Export unter Exchange Server 2010 SP wie geschmiert. Ich habe alles nochmal als Zip Datei zum Download bereitgestellt, darin sind alle Kommandos nochmals als Textdatei zusammengefasst, und die PS1 und BAT File für den automatisierten Export.
Download PSTexport2010sp1.zip
Donnerstag, 12. Mai 2011
Improved Mailbox Import/Export in Exchange 2010 SP1
As mentioned in my previous article, An Overview of Exchange 2010 SP1, the latest Exchange service pack brings some new enhancements to the way Exchange Administrators will import and export data to/from PST files.
Note: All the information is based on the SP1 BETA released in June 2010 (version 14.01.0180.002). Please keep in mind that things may change by the time this reaches final release.
A bit of History
If you've been around long enough, you will remember the ExMerge.exe utility that allowed to import and export data to/from Exchange mailboxes. Introduced in the days of Exchange 4.0, ExMerge stuck around till Exchange 2007 was released. This introduced the Import-Mailbox and Export-Mailbox cmdlets intended to replace ExMerge. The new cmdlets did not allow exporting of mailboxes to PSTs until the release of Exchange 2007 SP1. Even then, and in Exchange 2010 RTM after that, there was a requirement to have Outlook installed, because Exchange relied on the Outlook MAPI provider. In fact, to use the Export-Mailbox cmdlet in Exchange 2010 you have to have Outlook 2010 x64 installed on the same machine (as Alexander Zammit explains in his article Exchange 2010 Import-Mailbox and Export-Mailbox).
Exchange 2010 SP1 removes the requirement to have Outlook x64 installed by including an in-built MAPI provider. This is probably going to be one of the most welcomed additions to this improved piece of functionality.
The new Import and Export cmdlets
Let us now take a look at the new cmdlets available for the MailboxImportRequest and MailboxExportRequest commands and a small description for each:
MailboxImportRequest
| Cmdlet | Description |
| New-MailboxImportRequest | Start an import operation from a PST to a mailbox |
| Get-MailboxImportRequest | View mailbox import details |
| Set-MailboxImportRequest | Change the options of an import request |
| Suspend-MailboxImportRequest | Suspend an import request |
| Resume-MailboxImportRequest | Resume a suspended import request |
| Remove-MailboxImportRequest | Remove an import request |
| Get-MailboxImportRequestStatistics | View a more detailed set of import stats |
MailboxExportRequest
| Cmdlet | Description |
| New-MailboxExportRequest | Start an export operation from a mailbox to a PST |
| Get-MailboxExportRequest | View mailbox export details |
| Set-MailboxExportRequest | Change the options of an export request |
| Suspend-MailboxExportRequest | Suspend an export request |
| Resume-MailboxExportRequest | Resume a suspended export request |
| Remove-MailboxExportRequest | Remove an export request |
| Get-MailboxExportRequestStatistics | View a more detailed set of export stats |
When using the New-MailboxExportRequest cmdlet, you can also specify the -ContentFilter parameter with special properties that allow you to export only those messages that meet certain criteria. More information on the -ContentFilter parameter can be found at:
http://technet.microsoft.com/en-us/library/ff601762(EXCHG.141).aspx
Prerequisites
There are a number of requirements that need to be met to ensure that the Import or Export process goes smoothly. These include:
The Microsoft Exchange Mailbox Replication service needs to be started. This service handles the import/export requests.
The Exchange Trusted Subsystem Security Group should be granted Full Control permissions on the folder where the PST files will reside:
When specifying the PST file path, you have to use the UNC format (even if the file is stored locally). For example the UNC path for the file c:\PST\RachelPeach2010.pst, on a server named EXCHSRV:
\\EXCHSRV\C$\PST\RachelPeach2010.pstHere I am using the C$ administrative share. Of course you can create shares manually and change the path accordingly.
The administrator that is going to perform the import or export needs to have appropriate permissions in Exchange. Follow the instructions in the section that follows to configure the required permissions.
Configuring Import / Export Permissions
You first need to create a group that grants access to the Import and Export cmdlets. The command to do this is:
New-RoleGroup "Mailbox Import Export Group" -Roles "Mailbox Import Export"Next, you will need to add the administrator (and other designated users) to the role group. The command to do this is:
Add-RoleGroupMember "Mailbox Import Export Group" -Member "Administrator"That's it! You are now ready to start the import/export process.
Importing from a PST
We will now look at an example of how to import a mailbox from a PST.
When importing from a PST the cmdlet itself takes care of ensuring that subfolders are carried over too. By default, it also checks for duplicates in the target mailbox so that items will not be imported twice.
Below is an image showing Rachel Peach's mailbox prior to running the New-MailboxImportRequest cmdlet:
To import Rachel's PST into her mailbox, we can run the following command:New-MailboxImportRequest -Mailbox "Rachel Peach" -FilePath \\win2008srv01\c$\PST\RachelPeach2010.pst
The image below shows Rachel Peach's mailbox with the new items that were imported from the PST:
If you wish to import the e-mails into the Personal Archive of a user, specify the -IsArchive parameter at the end of the cmdlet, like this:New-MailboxImportRequest -Mailbox "Rachel Peach" -FilePath \\win2008srv01\c$\PST\RachelPeach2010.pst -IsArchive
If you wish to specify which folder you'd like the e-mails to be imported to, specify the -TargetRootFolder parameter at the end of the cmdlet, like this:New-MailboxImportRequest -Mailbox "Rachel Peach" -FilePath \\win2008srv01\c$\PST\RachelPeach2010.pst -TargetRootFolder "Imported"
To check the status of the import request, we can use the Get-MailboxImportRequest cmdlet:
Exporting a Mailbox to a PST
Finally, we'll look at how to export a mailbox to a PST using the New-MailboxExportRequest cmdlet. Below is an image showing Rachel Peach's mailbox prior to exporting the mailbox:
To initiate a mailbox export request, we will have to use the following command:New-MailboxExportRequest -Mailbox "Rachel Peach" -Filepath "\\win2008srv01\c$\PST\RachelPeachMailboxJuly2010.pst"
We can check the status of this export request by using the Get-MailboxExportRequest cmdlet. The image below shows the RachelPeachMailboxJuly2010.pst in the C:\PST folder, as well as opened in Microsoft Outlook 2010:
Exporting Multiple Mailboxes
If you wish to export multiple mailboxes into a respective PST file, you can do so using a simple script, as shown below:foreach ($mbx in (Get-Mailbox)) { New-MailboxExportRequest -Mailbox $mbx -FilePath "\\win2008srv01\c$\PST\$($mbx.Alias).pst" }
What we're doing here is looping through each mailbox and running the New-MailboxExportRequest cmdlet while using the mailbox Alias to compile a unique name for each PST.
Conclusion
As we have seen, the New-MailboxImportRequest and New-MailboxExportRequest cmdlets are going to make the Exchange Admins lives much easier. The fact that Outlook 2010 x64 doesn't need to be installed is a welcomed addition that should eliminate some of the frustration that was built around the Import-Mailbox and Export-Mailbox cmdlets in Exchange 2010 RTM.
Donnerstag, 21. April 2011
Exportieren von PST aus Exchange 2010 automatisieren
In diesem Artikel habe ich euch gezeigt, wie Ihr den Export von PST-Dateien aus Microsoft Exchange 2010 aktiviert, nun zeige ich euch, wie ihr das ganze automatisieren könnt.
Als erstes erstellen wir eine Datei namens “Export.ps1” mit folgendem Inhalt
Get-Mailbox -Database “Mailbox Database“ | Export-Mailbox -PSTFolderPath d:\PST
wobei ihr noch der Datenbanknamen anzupassen ist, und das Verzeichniss muss noch auf eures geändert werden. Mit diesem Befehl werden alle Mailboxen in ihre entsprechende PST Datei exportiert, also eine komplette Sicherung. Speichert diese Datei am besten in den PST Ordner.
Erstellt in diesem eine BAT oder CMD Datei mit folgendem Inhalt
powershell -PSConsoleFile “C:\Program Files\Microsoft\Exchange Server\V14\Bin\exshell.psc1″ -command D:\pst\export.ps1 > D:\pst\pstbackup-log.txt
Hier ist darauf zu achten das der Pfad zur “exdhell.psc1” angepasst wird, genauso wie zu unserer “export.ps1” und das Log muss noch wo abgelegt werden. Unsere erstellt “BAT oder CMD Datei kann somit als Task eingerichtet werden. Somit haben wir eine komplette Exchange 2010 Sicherung
Export PST von Exchange 2010
Man sollte glauben, dass Microsoft etwas dazugelernt hat, seit Exchange 2007, was das exportieren von PST-Dateien angeht, leider nein, darum hier eine Anleitung und Fehlerbehebung bis das Ganze funktioniert.
Zuerst einmal müssen wir das Mailbox-Export CMDlet aktivieren, also für einen User oder Gruppe freischalten.
Wir öffnen die Powershell Konsole am Exchange 2010 Server und tippen folgendes ein für einen User
New-ManagementRoleAssignment –Role “Mailbox Import Export” –User “Administrator”
oder eine Gruppe
New-ManagementRoleAssignment –Role “Mailbox Import Export” –Group “MailboxAccessGroup”
danach sollte das “Export-Mailbox” CMDlet” verfügbar sein, jedoch war das noch lange nicht alles.
Auf dem Exchange 2010 Server muss ein Outlook 2010 x64 installiert werden, nicht wie früher auf einer Remote Maschine, sondern direkt am Mail Server. Was früher ein No-Go von Microsoft war, ist heute Voraussetzung. Nachdem wir Outlook installiert haben, testen wir mal den Befehl.
Export-Mailbox –Identity *USER* –PSTFolderPath *PFAD*
Laut Microsoft solls nun bei allen funktionieren, bei mir, und vielen anderen, tut es das nicht sondern es folgt ein Fehler
Fehler für Admin (Admin@domain.com). Ursache: Fehler im Schritt: Das Objekt wird genehmigt. Unbekannter Fehler., Fehlercode
: -2147221219.
+ CategoryInfo : InvalidOperation: (0:Int32) [Export-Mailbox], RecipientTaskException
+ FullyQualifiedErrorId : E54E4C23,Microsoft.Exchange.Management.RecipientTasks.ExportMailbox
Laut einigen Artikeln, sollte man einen zusätzlichen Microsoft Exchange 2010 Server installieren, einmal die Postfächer verschieben, und das war, is ja ein Klacks. ![]()
Hier eine etwas schnellere Lösung.
Startet am DomainController ADSI Edit, öffnet eine Verbindung laut Screenshot
Wechselt laut Screenshot zu eurer Mail DB,
Rechtsklick auf die gewünschte Database, Registerkarte Sicherheit, fügt ihr den “System” Benutzer hinzu und gebt ihm folgende Rechte.
- Read
- Administer information store
- Allow Impersonation to Personal Exchange…
- Create named properties in the information store
- Open mail send queue
- Receive as
- Send as
- View information store status
Danach noch zur Sicherheit den Information Store neu starten, danach sollte euer PST Export ohne Probleme durchlaufen. Im nächste Artikel zeige ich euch wie Ihr das ganze automatisieren könnt, damit alle User in PST Files exportiert werden.
Wenn ihr den Export-Job denoch von einer Remote-Maschine starten wollt, müsst Ihr auf dieser noch die Microsoft Exchange 2010 Verwaltungstools installieren und unbedingt Outlook 2010 x64 auf dem Mail Server
Rename Onedrive Business root folder
Rename Onedrive Business root folder Here is what I remember: In the Office 365 web admin pages, change the organization name to a shorte...
-
One of the visitors of this blog asked the question if we could publish a list of recommended post Windows Server 2008 R2 SP1 hotfixes rela...
-
With your Windows Network working and a number of resources shared, you can install the TCP/IP Protocol to allow your Windows for Workgrou...