{"id":1284,"date":"2023-03-19T18:24:56","date_gmt":"2023-03-19T18:24:56","guid":{"rendered":"https:\/\/www.mozesoft.com\/blog\/?p=1284"},"modified":"2023-03-19T18:24:57","modified_gmt":"2023-03-19T18:24:57","slug":"recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets","status":"publish","type":"post","link":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/","title":{"rendered":"Recover a user and mailbox in Exchange online with PowerShell cmdlets"},"content":{"rendered":"\n<p>To recover a user and mailbox in Exchange Online with PowerShell cmdlets, follow the steps below:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Connect to Exchange Online PowerShell using your admin credentials.<\/li><li>Run the following command to retrieve a list of deleted users:Get-MsolUser -ReturnDeletedUsers<\/li><li>Identify the user that you want to restore and note their UserPrincipalName (UPN) value.<\/li><li>Run the following command to restore the user:Restore-MsolUser -UserPrincipalName &lt;UserUPN&gt;Replace &lt;UserUPN&gt; with the UPN of the user you want to restore.<\/li><li>Wait for the user to be restored. This process can take up to 24 hours.<\/li><li>Once the user is restored, run the following command to retrieve their Exchange Online mailbox:Get-Mailbox -Identity &lt;UserUPN&gt;Replace &lt;UserUPN&gt; with the UPN of the user you restored.<\/li><li>Once you have the mailbox identity, run the following command to restore the mailbox:New-MailboxRestoreRequest -Identity &lt;MailboxIdentity&gt; -TargetMailbox &lt;TargetMailbox&gt; -AllowLegacyDNMismatchReplace &lt;MailboxIdentity&gt; with the identity of the mailbox you want to restore, and &lt;TargetMailbox&gt; with the mailbox where you want to restore the deleted mailbox. The -AllowLegacyDNMismatch parameter allows you to restore the mailbox even if the legacyExchangeDN value of the restored mailbox does not match the legacyExchangeDN value of the original mailbox.<\/li><li>Wait for the mailbox restore request to complete. This process can take several hours, depending on the size of the mailbox.<\/li><li>Once the mailbox restore request is complete, run the following command to verify that the mailbox has been restored:Get-MailboxStatistics -Identity &lt;TargetMailbox&gt;Replace &lt;TargetMailbox&gt; with the mailbox where you restored the deleted mailbox.<\/li><\/ol>\n\n\n\n<p>That&#8217;s it! With these steps, you can easily recover a user and mailbox in Exchange Online using PowerShell cmdlets.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To recover a user and mailbox in Exchange Online with PowerShell cmdlets, follow the steps below: Connect to Exchange Online PowerShell using your admin credentials. Run the following command to retrieve a list of deleted users:Get-MsolUser -ReturnDeletedUsers Identify the user that you want to restore and note their UserPrincipalName (UPN) value. Run the following command [&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":[],"class_list":["post-1284","post","type-post","status-publish","format-standard","hentry","category-exchange-server"],"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 cmdlets<\/title>\n<meta name=\"description\" content=\"Recover a user and mailbox in Exchange online with PowerShell cmdlets\" \/>\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-and-mailbox-in-exchange-online-with-powershell-cmdlets\/\" \/>\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 cmdlets\" \/>\n<meta property=\"og:description\" content=\"Recover a user and mailbox in Exchange online with PowerShell cmdlets\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-19T18:24:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-19T18:24:57+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=\"2 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-and-mailbox-in-exchange-online-with-powershell-cmdlets\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/\"},\"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-03-19T18:24:56+00:00\",\"dateModified\":\"2023-03-19T18:24:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/\"},\"wordCount\":294,\"articleSection\":[\"Exchange Server\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/\",\"url\":\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/\",\"name\":\"Recover a user and mailbox in Exchange online with PowerShell cmdlets\",\"isPartOf\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/#website\"},\"datePublished\":\"2023-03-19T18:24:56+00:00\",\"dateModified\":\"2023-03-19T18:24:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/79fc1ff8cfa9fe3f16bedffefc53359c\"},\"description\":\"Recover a user and mailbox in Exchange online with PowerShell cmdlets\",\"breadcrumb\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/#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 cmdlets","description":"Recover a user and mailbox in Exchange online with PowerShell cmdlets","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-and-mailbox-in-exchange-online-with-powershell-cmdlets\/","og_locale":"en_US","og_type":"article","og_title":"Recover a user and mailbox in Exchange online with PowerShell cmdlets","og_description":"Recover a user and mailbox in Exchange online with PowerShell cmdlets","og_url":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/","og_site_name":"Blog","article_published_time":"2023-03-19T18:24:56+00:00","article_modified_time":"2023-03-19T18:24:57+00:00","author":"Adsank","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Adsank","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/#article","isPartOf":{"@id":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/"},"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-03-19T18:24:56+00:00","dateModified":"2023-03-19T18:24:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/"},"wordCount":294,"articleSection":["Exchange Server"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/","url":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/","name":"Recover a user and mailbox in Exchange online with PowerShell cmdlets","isPartOf":{"@id":"https:\/\/www.mozesoft.com\/blog\/#website"},"datePublished":"2023-03-19T18:24:56+00:00","dateModified":"2023-03-19T18:24:57+00:00","author":{"@id":"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/79fc1ff8cfa9fe3f16bedffefc53359c"},"description":"Recover a user and mailbox in Exchange online with PowerShell cmdlets","breadcrumb":{"@id":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.mozesoft.com\/blog\/recover-a-user-and-mailbox-in-exchange-online-with-powershell-cmdlets\/#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\/1284","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=1284"}],"version-history":[{"count":1,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/posts\/1284\/revisions"}],"predecessor-version":[{"id":1285,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/posts\/1284\/revisions\/1285"}],"wp:attachment":[{"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/media?parent=1284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/categories?post=1284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/tags?post=1284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}