{"id":1385,"date":"2023-04-23T17:59:12","date_gmt":"2023-04-23T17:59:12","guid":{"rendered":"https:\/\/www.mozesoft.com\/blog\/?p=1385"},"modified":"2023-12-23T15:30:56","modified_gmt":"2023-12-23T15:30:56","slug":"recover-a-user-mailbox-in-exchange-online-with-powershell","status":"publish","type":"post","link":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/","title":{"rendered":"Recover a user and mailbox in Exchange online with PowerShell cmdlets"},"content":{"rendered":"\n<p>Exchange Online is a cloud-based email and calendaring solution from Microsoft that is designed to provide businesses with enterprise-class messaging capabilities. One of the key features of Exchange Online is the ability to manage users and mailboxes through PowerShell cmdlets. In this article, we will explore the steps involved in recovering a user and mailbox in Exchange Online using PowerShell cmdlets.<\/p>\n\n\n\n<p>Before we dive into the recovery process, it is important to understand why you might need to recover a user and mailbox. There are several scenarios where this might be necessary, such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The user account has been accidentally deleted.<\/li><li>The user has left the company and their mailbox needs to be accessed by someone else.<\/li><li>The mailbox has been corrupted or damaged.<\/li><\/ul>\n\n\n\n<p>Regardless of the reason, the recovery process is relatively straightforward with the use of PowerShell cmdlets.<\/p>\n\n\n\n<p>Step 1: Connect to Exchange Online<\/p>\n\n\n\n<p>The first step is to connect to Exchange Online using PowerShell. This requires the Exchange Online PowerShell module to be installed on your computer. If you haven&#8217;t already done so, you can download and install the module from the Microsoft website.<\/p>\n\n\n\n<p>Once the module is installed, open PowerShell as an administrator and run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">code<code>Connect-ExchangeOnline -UserPrincipalName &lt;UPN&gt;\n<\/code><\/pre>\n\n\n\n<p>Replace <code>&lt;UPN&gt;<\/code> with the user principal name of your Exchange Online administrator account. This will establish a connection to Exchange Online.<\/p>\n\n\n\n<p>Step 2: Identify the User and Mailbox<\/p>\n\n\n\n<p>The next step is to identify the user and mailbox that needs to be recovered. You can do this by running the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Get-Mailbox -Identity &lt;MailboxIdentity&gt;\n<\/code><\/pre>\n\n\n\n<p>Replace <code>&lt;MailboxIdentity&gt;<\/code> with the email address or username of the user whose mailbox needs to be recovered. This will return information about the user and their mailbox, including the mailbox GUID.<\/p>\n\n\n\n<p>Step 3: Restore the User Account<\/p>\n\n\n\n<p>If the user account has been accidentally deleted, it needs to be restored before the mailbox can be recovered. To restore the user account, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Restore-MsolUser -UserPrincipalName &lt;UPN&gt;\n<\/code><\/pre>\n\n\n\n<p>Replace <code>&lt;UPN&gt;<\/code> with the user principal name of the deleted user account. This will restore the user account and all associated attributes, including the mailbox.<\/p>\n\n\n\n<p>Step 4: Recover the Mailbox<\/p>\n\n\n\n<p>Once the user account has been restored, you can recover the mailbox using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>New-MailboxRestoreRequest -SourceDatabase &lt;DatabaseName&gt; -SourceStoreMailbox &lt;MailboxGUID&gt; -TargetMailbox &lt;TargetMailbox&gt;\n<\/code><\/pre>\n\n\n\n<p>Replace <code>&lt;DatabaseName&gt;<\/code> with the name of the database where the mailbox was located, <code>&lt;MailboxGUID&gt;<\/code> with the GUID of the mailbox that needs to be recovered, and <code>&lt;TargetMailbox&gt;<\/code> with the email address or username of the target mailbox where the recovered items will be placed.<\/p>\n\n\n\n<p>This command will create a new mailbox restore request and begin the recovery process. You can monitor the progress of the restore request by running the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Get-MailboxRestoreRequest | Get-MailboxRestoreRequestStatistics\n<\/code><\/pre>\n\n\n\n<p>Step 5: Verify the Recovery<\/p>\n\n\n\n<p>Once the mailbox restore request has completed, you can verify that the mailbox has been recovered by running the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Get-Mailbox -Identity &lt;MailboxIdentity&gt; | fl ExchangeGUID\n<\/code><\/pre>\n\n\n\n<p>Replace <code>&lt;MailboxIdentity&gt;<\/code> with the email address or username of the user whose mailbox was recovered. This will return the ExchangeGUID of the recovered mailbox, which should match the ExchangeGUID of the original mailbox.<\/p>\n\n\n\n<p>Conclusion<\/p>\n\n\n\n<p>Recovering a user and mailbox in Exchange Online using PowerShell cmdlets is a straightforward process that can be completed in just a few steps. By following the steps outlined in this article, you can quickly and easily recover a user and mailbox in Exchange Online<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Exchange Online is a cloud-based email and calendaring solution from Microsoft that is designed to provide businesses with enterprise-class messaging capabilities. One of the key features of Exchange Online is the ability to manage users and mailboxes through PowerShell cmdlets. In this article, we will explore the steps involved in recovering a user and mailbox [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[94],"class_list":["post-1385","post","type-post","status-publish","format-standard","hentry","category-exchange-server","tag-recover-user-mailboxes"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Recover a user and mailbox in Exchange online with PowerShell<\/title>\n<meta name=\"description\" content=\"Recover a user and mailbox in Exchange online with PowerShell cmdlets - Exchange Online is a cloud-based email and calendaring solution.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Recover a user and mailbox in Exchange online with PowerShell\" \/>\n<meta property=\"og:description\" content=\"Recover a user and mailbox in Exchange online with PowerShell cmdlets - Exchange Online is a cloud-based email and calendaring solution.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-23T17:59:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-23T15:30:56+00:00\" \/>\n<meta name=\"author\" content=\"Adsank\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Adsank\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/\"},\"author\":{\"name\":\"Adsank\",\"@id\":\"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/79fc1ff8cfa9fe3f16bedffefc53359c\"},\"headline\":\"Recover a user and mailbox in Exchange online with PowerShell cmdlets\",\"datePublished\":\"2023-04-23T17:59:12+00:00\",\"dateModified\":\"2023-12-23T15:30:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/\"},\"wordCount\":542,\"keywords\":[\"Recover user mailboxes\"],\"articleSection\":[\"Exchange Server\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/\",\"url\":\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/\",\"name\":\"Recover a user and mailbox in Exchange online with PowerShell\",\"isPartOf\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/#website\"},\"datePublished\":\"2023-04-23T17:59:12+00:00\",\"dateModified\":\"2023-12-23T15:30:56+00:00\",\"author\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/79fc1ff8cfa9fe3f16bedffefc53359c\"},\"description\":\"Recover a user and mailbox in Exchange online with PowerShell cmdlets - Exchange Online is a cloud-based email and calendaring solution.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.mozesoft.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Recover a user and mailbox in Exchange online with PowerShell cmdlets\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.mozesoft.com\/blog\/#website\",\"url\":\"https:\/\/www.mozesoft.com\/blog\/\",\"name\":\"Blog\",\"description\":\"IT Knowledgebase\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.mozesoft.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/79fc1ff8cfa9fe3f16bedffefc53359c\",\"name\":\"Adsank\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/16e1b860aa1c6c11b188d686f734c33318307888d91fee8cd1550025f1c788a0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/16e1b860aa1c6c11b188d686f734c33318307888d91fee8cd1550025f1c788a0?s=96&d=mm&r=g\",\"caption\":\"Adsank\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Recover a user and mailbox in Exchange online with PowerShell","description":"Recover a user and mailbox in Exchange online with PowerShell cmdlets - Exchange Online is a cloud-based email and calendaring solution.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Recover a user and mailbox in Exchange online with PowerShell","og_description":"Recover a user and mailbox in Exchange online with PowerShell cmdlets - Exchange Online is a cloud-based email and calendaring solution.","og_url":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/","og_site_name":"Blog","article_published_time":"2023-04-23T17:59:12+00:00","article_modified_time":"2023-12-23T15:30:56+00:00","author":"Adsank","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Adsank","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/#article","isPartOf":{"@id":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/"},"author":{"name":"Adsank","@id":"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/79fc1ff8cfa9fe3f16bedffefc53359c"},"headline":"Recover a user and mailbox in Exchange online with PowerShell cmdlets","datePublished":"2023-04-23T17:59:12+00:00","dateModified":"2023-12-23T15:30:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/"},"wordCount":542,"keywords":["Recover user mailboxes"],"articleSection":["Exchange Server"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/","url":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/","name":"Recover a user and mailbox in Exchange online with PowerShell","isPartOf":{"@id":"https:\/\/www.mozesoft.com\/blog\/#website"},"datePublished":"2023-04-23T17:59:12+00:00","dateModified":"2023-12-23T15:30:56+00:00","author":{"@id":"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/79fc1ff8cfa9fe3f16bedffefc53359c"},"description":"Recover a user and mailbox in Exchange online with PowerShell cmdlets - Exchange Online is a cloud-based email and calendaring solution.","breadcrumb":{"@id":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-mailbox-in-exchange-online-with-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.mozesoft.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Recover a user and mailbox in Exchange online with PowerShell cmdlets"}]},{"@type":"WebSite","@id":"https:\/\/www.mozesoft.com\/blog\/#website","url":"https:\/\/www.mozesoft.com\/blog\/","name":"Blog","description":"IT Knowledgebase","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mozesoft.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/79fc1ff8cfa9fe3f16bedffefc53359c","name":"Adsank","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/16e1b860aa1c6c11b188d686f734c33318307888d91fee8cd1550025f1c788a0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/16e1b860aa1c6c11b188d686f734c33318307888d91fee8cd1550025f1c788a0?s=96&d=mm&r=g","caption":"Adsank"}}]}},"_links":{"self":[{"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/posts\/1385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/comments?post=1385"}],"version-history":[{"count":3,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/posts\/1385\/revisions"}],"predecessor-version":[{"id":1523,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/posts\/1385\/revisions\/1523"}],"wp:attachment":[{"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/media?parent=1385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/categories?post=1385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/tags?post=1385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}