{"id":115,"date":"2018-03-21T18:43:02","date_gmt":"2018-03-21T18:43:02","guid":{"rendered":"http:\/\/www.blog.mozesoft.com\/?p=115"},"modified":"2018-05-03T16:03:32","modified_gmt":"2018-05-03T16:03:32","slug":"restore-exchange-server-database-mailboxes-with-powershell","status":"publish","type":"post","link":"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/","title":{"rendered":"Restore Exchange Server Database Mailboxes with PowerShell"},"content":{"rendered":"<p>Time and again, it happens that we delete an email and sometimes, in the future it is required. While it might be a bit difficult for you to restore your personal emails which you once deleted, but, if you are using the MS Exchange Server and MS Outlook, then it is possible.<\/p>\n<p>The &#8220;Powershell&#8221; can help you restore the messages or other items which you once deleted from the Exchange 2016 recovery database. Using Powershell, you can even restore Exchange Server database whenever required.<\/p>\n<p>How Exchange Server 2016 Supports Recovery of Deleted Objects?<\/p>\n<p>Microsoft has equipped the Exchange Server 2016 with a recovery database which can be used for restoring the information, deleted emails, messages and many other items from the mailboxes.<\/p>\n<p>An organization which runs Exchange 2016 on a single server in the branch office or don&#8217;t have a database availability group can leverage the Exchange Recovery database. The recovery databases are the special mailboxes which store the entire information and can be used to obtain the deleted information or emails. But, these can only be accessed only by the admins. These databases can help to repair Exchange Server in a simple yet effective manner.<\/p>\n<p>How To Recover The Deleted Emails From Recovery Database?<\/p>\n<p>In order to execute the email message restoration process, a few steps are required to be followed. These steps include:<\/p>\n<p>1. Build The Recovery Database<\/p>\n<p>First of all, the administrator is required to create a new database object on the current Exchange Deployment and identify it as the recovery database. This new database object will hold the content that we want to be restored.<\/p>\n<p>Run the following Powershell command to build the recovery database:<\/p>\n<p>New-MailboxDatabase -Server EXCHANGE2016 -Name RDatabase -Recovery -EdbFilePath c:\\exchange.edb -LogFolderPath c:\\logs<\/p>\n<p>The use of the &#8220;-Recovery&#8221; flag in the command is used to instruct the Exchange that this new database which is being created should not be used as a typical mailbox database.<\/p>\n<p>2. Restore The Production Database<\/p>\n<p>After this, the admin is required to restore a production database into the recently created recovery database. It will copy the data from the backup to the new recovery space.<\/p>\n<p>You can use a software of any other backup process. Once the backup is complete, restore the files to the folder locations used in the PowerShell command executed above for creating the Exchange Recovery database.<\/p>\n<p>3. Put Database Into Readable Condition<\/p>\n<p>Now, Exchange is required to read from the mounted database, so it&#8217;s important to put it in the readable condition. So, find out the location of the recovery database and then run the following &#8220;ESEUTIL&#8221; command from the command prompt.<\/p>\n<p>eseutil \/r log_file_base_name \/l c:\\path_to_log_files \/d c:\\path_to_database<\/p>\n<p>Before moving ahead, its vital to check the state of the database. So, run the following command from the database directory and find out the current state of the database.<\/p>\n<p>eseutil \/mh databasename.edb<\/p>\n<p>If it says &#8220;Clean Shutdown&#8221;, you can move ahead. Next, you need to mount the database, so use the following command.<\/p>\n<p>Mount-Database Name of the database<\/p>\n<p>When you execute the above command with the database name that was created in the first step, it will be mounted.<\/p>\n<p>4. Restoration of Deleted Mails and Information<\/p>\n<p>Finally, the admin is required to run the mailbox recovery requests from bringing the data fom the mounted recovery database to the corresponding mailboxes or the different archives or mailboxes to the production side.<\/p>\n<p>Once the database has mounted, you can choose any of the follwoing options to carry out the restoration.<\/p>\n<p>\u2022 To restore the contents from a mailbox from the recovery database to its identical mailbox located in the production database, run following command:<\/p>\n<p>New-MailboxRestoreRequest -Name &#8220;AB Restore&#8221; -SourceDatabase TheRecoveryDatabase -SourceStoreMailbox &#8220;AB&#8221; -TargetMailbox &#8220;AB&#8221;<\/p>\n<p>\u2022 To restore the specific folders from a particular database to a different mailbox, a corresponding mailbox or a target archive mailbox, run the following command<br \/>\nNew-MailboxRestoreRequest -Name &#8220;AB Restore&#8221; -SourceDatabase TheRecoveryDatabase -SourceStoreMailbox &#8220;AB&#8221; -TargetMailbox &#8220;AB&#8221; -IncludeFolders &#8220;Immigration Papers\/*&#8221;<\/p>\n<p>\u2022 To restore the contents from a recovery database on an archive database, run the following command<\/p>\n<p>New-MailboxRestoreRequest -Name &#8220;AB Restore&#8221; -SourceDatabase TheRecoveryDatabase -SourceStoreMailbox &#8220;AB&#8221; -TargetMailbox &#8220;AB&#8221; \u2013TargetRootFolder &#8220;Your Restored Items&#8221;<\/p>\n<p>\u2022 To restore contents from one mailbox on the recovery database to another mailbox located on the production database, run the following command:<\/p>\n<p>New-MailboxRestoreRequest -Name &#8220;AB Restore&#8221; -SourceDatabase TheRecoveryDatabase -SourceStoreMailbox &#8220;AB&#8221; -TargetMailbox &#8220;AB&#8221; \u2013TargetRootFolder &#8220;Your Restored Items&#8221; -AllowLegacyDNMismatch<\/p>\n<p>\u2022 Lastly, for restoring the contents from the in-built folders, attach the &#8220;Hashtag&#8221; in front and end of the folder&#8217;s name. For example #Inbox# or #Deleted Items#<\/p>\n<p>What To Do When Name Conflict Arises?<\/p>\n<p>Sometimes, when you are trying to restore the data, an email or some other item, an item with the same name may already exist in the destination folder. In such scenario, the admin is required to dictate that which data should be kept, the new one or the existing one, or both. You can use the &#8220;-ConflictResolutionOption&#8221; parameter in the PowerShell command to set these options.<\/p>\n<p>Some examples of these commands include:<\/p>\n<p>When you want to keep the source data or item<\/p>\n<p>New-MailboxRestoreRequest -Name &#8220;AB Restore&#8221; -SourceDatabase TheRecoveryDatabase -SourceStoreMailbox &#8220;AB&#8221; -TargetMailbox &#8220;AB&#8221; \u2013ConflictResolutionOption KeepSourceItem<\/p>\n<p>When you want to keep the lastest data or item<\/p>\n<p>New-MailboxRestoreRequest -Name &#8220;AB Restore&#8221; -SourceDatabase TheRecoveryDatabase -SourceStoreMailbox &#8220;AB&#8221; -TargetMailbox &#8220;AB&#8221; \u2013ConflictResolutionOption KeepLatestItem<\/p>\n<p>When you want to keep both<\/p>\n<p>New-MailboxRestoreRequest -Name &#8220;AB Restore&#8221; -SourceDatabase TheRecoveryDatabase -SourceStoreMailbox &#8220;AB&#8221; -TargetMailbox &#8220;AB&#8221; \u2013ConflictResolutionOption KeepAll<\/p>\n<p>The Final Word!!<\/p>\n<p>So, now if you delete some mail from your MS Outlook accidentally or intentionally, and need it back again, you need not to worry as a set of PowerShell commands can be used to restore the emails or information.<\/p>\n<p>These commands are easy to execute and have a simple syntax. However, if you are looking for an easier way to restore the lost data, you can use the specialized software solutions designed specifically for this purpose.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Time and again, it happens that we delete an email and sometimes, in the future it is required. While it might be a bit difficult for you to restore your personal emails which you once deleted, but, if you are using the MS Exchange Server and MS Outlook, then it is possible. The &#8220;Powershell&#8221; can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-115","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>Restore Exchange Server Database Mailboxes with PowerShell - Blog<\/title>\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\/restore-exchange-server-database-mailboxes-with-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Restore Exchange Server Database Mailboxes with PowerShell - Blog\" \/>\n<meta property=\"og:description\" content=\"Time and again, it happens that we delete an email and sometimes, in the future it is required. While it might be a bit difficult for you to restore your personal emails which you once deleted, but, if you are using the MS Exchange Server and MS Outlook, then it is possible. The &#8220;Powershell&#8221; can [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-21T18:43:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-05-03T16:03:32+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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/\"},\"author\":{\"name\":\"Adsank\",\"@id\":\"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/79fc1ff8cfa9fe3f16bedffefc53359c\"},\"headline\":\"Restore Exchange Server Database Mailboxes with PowerShell\",\"datePublished\":\"2018-03-21T18:43:02+00:00\",\"dateModified\":\"2018-05-03T16:03:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/\"},\"wordCount\":983,\"articleSection\":[\"Exchange Server\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/\",\"url\":\"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/\",\"name\":\"Restore Exchange Server Database Mailboxes with PowerShell - Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/#website\"},\"datePublished\":\"2018-03-21T18:43:02+00:00\",\"dateModified\":\"2018-05-03T16:03:32+00:00\",\"author\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/79fc1ff8cfa9fe3f16bedffefc53359c\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.mozesoft.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Restore Exchange Server Database Mailboxes with PowerShell\"}]},{\"@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":"Restore Exchange Server Database Mailboxes with PowerShell - Blog","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\/restore-exchange-server-database-mailboxes-with-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Restore Exchange Server Database Mailboxes with PowerShell - Blog","og_description":"Time and again, it happens that we delete an email and sometimes, in the future it is required. While it might be a bit difficult for you to restore your personal emails which you once deleted, but, if you are using the MS Exchange Server and MS Outlook, then it is possible. The &#8220;Powershell&#8221; can [&hellip;]","og_url":"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/","og_site_name":"Blog","article_published_time":"2018-03-21T18:43:02+00:00","article_modified_time":"2018-05-03T16:03:32+00:00","author":"Adsank","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Adsank","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/#article","isPartOf":{"@id":"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/"},"author":{"name":"Adsank","@id":"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/79fc1ff8cfa9fe3f16bedffefc53359c"},"headline":"Restore Exchange Server Database Mailboxes with PowerShell","datePublished":"2018-03-21T18:43:02+00:00","dateModified":"2018-05-03T16:03:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/"},"wordCount":983,"articleSection":["Exchange Server"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/","url":"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/","name":"Restore Exchange Server Database Mailboxes with PowerShell - Blog","isPartOf":{"@id":"https:\/\/www.mozesoft.com\/blog\/#website"},"datePublished":"2018-03-21T18:43:02+00:00","dateModified":"2018-05-03T16:03:32+00:00","author":{"@id":"https:\/\/www.mozesoft.com\/blog\/#\/schema\/person\/79fc1ff8cfa9fe3f16bedffefc53359c"},"breadcrumb":{"@id":"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.mozesoft.com\/blog\/restore-exchange-server-database-mailboxes-with-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.mozesoft.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Restore Exchange Server Database Mailboxes with PowerShell"}]},{"@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\/115","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=115"}],"version-history":[{"count":2,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/posts\/115\/revisions"}],"predecessor-version":[{"id":187,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/posts\/115\/revisions\/187"}],"wp:attachment":[{"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/media?parent=115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/categories?post=115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mozesoft.com\/blog\/wp-json\/wp\/v2\/tags?post=115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}