{"id":112,"date":"2021-07-04T20:55:32","date_gmt":"2021-07-04T18:55:32","guid":{"rendered":"https:\/\/schoppe.it\/wiki\/?p=112"},"modified":"2024-09-03T08:51:16","modified_gmt":"2024-09-03T06:51:16","slug":"nuetzliche-powershell-commands-exchange-server","status":"publish","type":"post","link":"https:\/\/schoppe.it\/wiki\/nuetzliche-powershell-commands-exchange-server\/","title":{"rendered":"N\u00fctzliche Powershell Commands &#8211; Exchange Server"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Postf\u00e4cher<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Inaktive (disconnected) Postf\u00e4cher<\/h3>\n\n\n\n<p>Befehl zeigt ID der inaktiven Postf\u00e4cher an. Die ID wird f\u00fcr das L\u00f6schen des Postfachs ben\u00f6tigt.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nget-mailboxdatabase | get-mailboxstatistics | Where{ $_.DisconnectDate -ne $null } |fl displayName,Identity,disconnectdate\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Inaktive Mailbox l\u00f6schen<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nRemove-Mailbox -database &quot;Mailbox Database 0123456789&quot; -storemailboxidentity &#x5B;ID der Mailbox]\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Ger\u00e4tepostf\u00e4cher<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nGet-Mailbox -ResultSize unlimited -Filter &quot;RecipientTypeDetails -eq &#039;EquipmentMailbox&#039;&quot; | ft Name, Alias\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Raumpostf\u00e4cher<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nGet-Mailbox -ResultSize unlimited -Filter &quot;RecipientTypeDetails -eq &#039;RoomMailbox&#039;&quot; | ft Name, Alias\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Berechtigungen<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Anzeige der vergebenen Berechtigungen eines Postfachs<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nGet-MailboxPermission &#x5B;Alias] | ft User, AccessRights\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Postf\u00e4cher, bei denen ein User oder eine AD-Gruppe Berechtigungen hat<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nGet-Mailbox -ResultSize Unlimited | Get-MailboxPermission -User {&#x5B;AD-User\/AD-Gruppe]} | Format-Table Identity, AccessRights, Deny\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Berechtigungen auf eine andere Gruppe \/ auf einen anderen User kopieren<\/h3>\n\n\n\n<p>Vorhandene Berechtigungen eines User \/einer Gruppe ermitteln und in einer Variablen speichern.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\n$Source = Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission -User {&#x5B;AD-User\/AD-Gruppe]}\n<\/pre><\/div>\n\n\n<p>Berechtigungen auf einen anderen User \/ eine andere Gruppe \u00fcbertragen via Schleife in PowerShell.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\n$Source | ForEach-Object {add-mailboxpermission $_.Identity -user &#x5B;AD-User\/AD-Gruppe] -accessrights $_.AccessRights -AutoMapping $false}\n<\/pre><\/div>\n\n\n<p>Korrekte Erfassung der Berechtigungen pr\u00fcfen. Wenn du in deinem Active Directory ein einheitliches Pr\u00e4frix f\u00fcr die globalen Gruppen verwendet hast, werden durch einen Filter nur die relevanten Gruppen angezeigt und nicht alle Standard-Permissions.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\n$Source | ForEach-Object {Get-MailboxPermission $_.Identity | Where-Object {$_.User -like &quot;*GG*&quot;} |  ft Identity, User, AccessRights}\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-gallery columns-2 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115716.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1054\" height=\"86\" src=\"https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115716.jpg\" alt=\"\" data-id=\"182\" data-full-url=\"https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115716.jpg\" data-link=\"https:\/\/schoppe.it\/wiki\/2021\/07\/04\/nuetzliche-powershell-commands-exchange-server\/screenshot-2021-07-30-115716\/\" class=\"wp-image-182\" srcset=\"https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115716.jpg 1054w, https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115716-300x24.jpg 300w, https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115716-1024x84.jpg 1024w, https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115716-768x63.jpg 768w\" sizes=\"auto, (max-width: 1054px) 100vw, 1054px\" \/><\/a><figcaption class=\"blocks-gallery-item__caption\">Mit Filter<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115220.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1542\" height=\"374\" src=\"https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115220.jpg\" alt=\"\" data-id=\"183\" data-full-url=\"https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115220.jpg\" data-link=\"https:\/\/schoppe.it\/wiki\/2021\/07\/04\/nuetzliche-powershell-commands-exchange-server\/screenshot-2021-07-30-115220\/\" class=\"wp-image-183\" srcset=\"https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115220.jpg 1542w, https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115220-300x73.jpg 300w, https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115220-1024x248.jpg 1024w, https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115220-768x186.jpg 768w, https:\/\/schoppe.it\/wiki\/wp-content\/uploads\/sites\/2\/2021\/07\/Screenshot-2021-07-30-115220-1536x373.jpg 1536w\" sizes=\"auto, (max-width: 1542px) 100vw, 1542px\" \/><\/a><figcaption class=\"blocks-gallery-item__caption\">Ohne Filter<\/figcaption><\/figure><\/li><\/ul><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Export und Import<\/h2>\n\n\n\n<p>Der Parameter muss gesetzt werden, wenn der Export bzw. der Import nicht durchgef\u00fchrt werden. \u00dcber <strong>Get-MailboxExportRequest<\/strong> und <strong>GetMailboxImportRequest<\/strong> k\u00f6nnen die Prozesse angezeigt werden.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nNew-MailboxExportRequest -Mailbox &#x5B;Alias] -FilePath \\localhost\\export\\exportdatei.pst -Priority highest\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nGet-MailboxExportRequest | Get-MailboxExportRequestStatistics -IncludeReport | fl\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nNew-MailboxImportRequest -Mailbox &#x5B;Alias] -FilePath \\localhost\\import\\importdatei.pst -Priority highest\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Adresslisten<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Adresslisten aktualisieren<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nget-addresslist | update-addresslist\nget-globaladdresslist | update-globaladdresslist\nget-offlineaddressbook | update-offlineaddressbook\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Postf\u00e4cher Inaktive (disconnected) Postf\u00e4cher Befehl zeigt ID der inaktiven Postf\u00e4cher an. Die ID wird f\u00fcr das L\u00f6schen des Postfachs ben\u00f6tigt. Inaktive Mailbox l\u00f6schen Ger\u00e4tepostf\u00e4cher Raumpostf\u00e4cher Berechtigungen Anzeige der vergebenen Berechtigungen eines Postfachs Postf\u00e4cher, bei denen ein User oder eine AD-Gruppe Berechtigungen hat Berechtigungen auf eine andere Gruppe \/ auf einen anderen User kopieren Vorhandene Berechtigungen&hellip; <a class=\"more-link\" href=\"https:\/\/schoppe.it\/wiki\/nuetzliche-powershell-commands-exchange-server\/\"><span class=\"screen-reader-text\">N\u00fctzliche Powershell Commands &#8211; Exchange Server<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,22],"tags":[],"powershell":[],"wordpress":[],"exchange":[83,85,74,80,78,77,76,81,87,75,79,82,84,86,88],"linux":[],"class_list":["post-112","post","type-post","status-publish","format-standard","hentry","category-microsoft-exchange-server","category-powershell","exchange-get-addresslist","exchange-get-globaladdresslist","exchange-get-mailbox","exchange-get-mailboxdatabase","exchange-get-mailboxexportrequest","exchange-get-mailboxexportrequeststatistics","exchange-get-mailboxpermission","exchange-get-mailboxstatistics","exchange-get-offlineaddressbook","exchange-new-mailboxexportrequest","exchange-new-mailboximportrequest","exchange-remove-mailbox","exchange-update-addresslist","exchange-update-globaladdresslist","exchange-update-offlineaddressbook","entry"],"_links":{"self":[{"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/posts\/112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/comments?post=112"}],"version-history":[{"count":6,"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/posts\/112\/revisions"}],"predecessor-version":[{"id":185,"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/posts\/112\/revisions\/185"}],"wp:attachment":[{"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/media?parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/categories?post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/tags?post=112"},{"taxonomy":"powershell","embeddable":true,"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/powershell?post=112"},{"taxonomy":"wordpress","embeddable":true,"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/wordpress?post=112"},{"taxonomy":"exchange","embeddable":true,"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/exchange?post=112"},{"taxonomy":"linux","embeddable":true,"href":"https:\/\/schoppe.it\/wiki\/wp-json\/wp\/v2\/linux?post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}