{"id":81,"date":"2009-05-28T02:06:46","date_gmt":"2009-05-28T07:06:46","guid":{"rendered":"http:\/\/www.bhargavs.com\/index.php\/technology\/2009\/05\/exchange-2007-powershell-force-mount-database\/"},"modified":"2009-05-28T02:06:46","modified_gmt":"2009-05-28T07:06:46","slug":"exchange-2007-powershell-force-mount-database","status":"publish","type":"post","link":"https:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/","title":{"rendered":"Force Mount-Database"},"content":{"rendered":"<p>I wanted to mount All mailbox databases from all servers that had them. This was a scenario where I had servers recovered with no DB files. I did not need them, I was going to start with empty databases. The command was going to be simple: <\/p>\n<pre lang=\"PowerShell\">Get-MailboxDatabase | Mount-Database -Confirm:$false<\/pre>\n<p>Except that this command had a major flaw. Can you guess?\n<\/p>\n<p><!--more--><br \/>\nWhen you run the command above, it will get all mailbox databases and try to mount them. As I described earlier, DB files do not exist so Exchange will create new files. You would assume that \u2013Confirm:$false will fly by confirmation prompts and you will have all DBs mounted when you return from your coffee run\u2026 WRONG.<\/p>\n<p>When you return from coffee run, the EMS will be waiting for your input!!! How did that happen? Why did \u2013confirm not work? It did. The prompt you have is not for confirming the operation of mounting the database. The prompt is for you to confirm that it is ok to create new empty DB files. This is crucial. If you accidentally mount DB when you meant to restore from backup, it could spell a disaster (wasn\u2019t it enough that you were dealing with one already?).<\/p>\n<p>Now, if you are sure that this is what you want to do and start with new empty DBs, you can do the following:<\/p>\n<pre lang=\"PowerShell\">Get-MailboxDatabase | Mount-Database \u2013Confirm:$false \u2013Force<\/pre>\n<p>Note the \u201c\u2013Force\u201d. Now you are telling Exchange to shut up and do what you asked it to do. You should now feel superior to that stupid computer who only does what you tell it to do.. or does it?<\/p>\n<p>Ref: You can read more about Mount-Database syntax and parameters <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/aa998871.aspx\">here<\/a>.<\/p>\n<p><strong><em>Quote of the day: <\/em><\/strong><\/p>\n<p>A man&#8217;s errors are his portals of discovery. &#8211; James Joyce<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to mount All mailbox databases from all servers that had them. This was a scenario where I had servers recovered with no DB files. I did not need [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[51,56,40,19],"tags":[121,126,127,139,182,212],"class_list":["post-81","post","type-post","status-publish","format-standard","hentry","category-exchange-2007","category-exchange-management-shell","category-exchange-server","category-powershell","tag-exchange-2007","tag-exchange-management-shell","tag-exchange-server","tag-get-mailboxdatabase","tag-mount-database","tag-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Force Mount-Database - Bhargav&#039;s IT Playground<\/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:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Force Mount-Database - Bhargav&#039;s IT Playground\" \/>\n<meta property=\"og:description\" content=\"I wanted to mount All mailbox databases from all servers that had them. This was a scenario where I had servers recovered with no DB files. I did not need [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/\" \/>\n<meta property=\"og:site_name\" content=\"Bhargav&#039;s IT Playground\" \/>\n<meta property=\"article:published_time\" content=\"2009-05-28T07:06:46+00:00\" \/>\n<meta name=\"author\" content=\"Bhargav\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bhargav\" \/>\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:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/05\\\/28\\\/exchange-2007-powershell-force-mount-database\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/05\\\/28\\\/exchange-2007-powershell-force-mount-database\\\/\"},\"author\":{\"name\":\"Bhargav\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/28f6d8c9b29f3a879483d65fc2ab5e26\"},\"headline\":\"Force Mount-Database\",\"datePublished\":\"2009-05-28T07:06:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/05\\\/28\\\/exchange-2007-powershell-force-mount-database\\\/\"},\"wordCount\":295,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/28f6d8c9b29f3a879483d65fc2ab5e26\"},\"keywords\":[\"Exchange 2007\",\"Exchange Management Shell\",\"Exchange Server\",\"Get-MailboxDatabase\",\"Mount-Database\",\"PowerShell\"],\"articleSection\":[\"Exchange 2007\",\"Exchange Management Shell\",\"Exchange Server\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/05\\\/28\\\/exchange-2007-powershell-force-mount-database\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/05\\\/28\\\/exchange-2007-powershell-force-mount-database\\\/\",\"url\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/05\\\/28\\\/exchange-2007-powershell-force-mount-database\\\/\",\"name\":\"Force Mount-Database - Bhargav&#039;s IT Playground\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#website\"},\"datePublished\":\"2009-05-28T07:06:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/05\\\/28\\\/exchange-2007-powershell-force-mount-database\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/05\\\/28\\\/exchange-2007-powershell-force-mount-database\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/index.php\\\/2009\\\/05\\\/28\\\/exchange-2007-powershell-force-mount-database\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/bhargavs.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Force Mount-Database\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#website\",\"url\":\"https:\\\/\\\/bhargavs.com\\\/\",\"name\":\"Bhargav's IT Playground\",\"description\":\"Passion for Technology. Power of Collaboration.\",\"publisher\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/28f6d8c9b29f3a879483d65fc2ab5e26\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/bhargavs.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/28f6d8c9b29f3a879483d65fc2ab5e26\",\"name\":\"Bhargav\",\"logo\":{\"@id\":\"https:\\\/\\\/bhargavs.com\\\/#\\\/schema\\\/person\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/bhargavs.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Force Mount-Database - Bhargav&#039;s IT Playground","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:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/","og_locale":"en_US","og_type":"article","og_title":"Force Mount-Database - Bhargav&#039;s IT Playground","og_description":"I wanted to mount All mailbox databases from all servers that had them. This was a scenario where I had servers recovered with no DB files. I did not need [&hellip;]","og_url":"https:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/","og_site_name":"Bhargav&#039;s IT Playground","article_published_time":"2009-05-28T07:06:46+00:00","author":"Bhargav","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Bhargav","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/#article","isPartOf":{"@id":"https:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/"},"author":{"name":"Bhargav","@id":"https:\/\/bhargavs.com\/#\/schema\/person\/28f6d8c9b29f3a879483d65fc2ab5e26"},"headline":"Force Mount-Database","datePublished":"2009-05-28T07:06:46+00:00","mainEntityOfPage":{"@id":"https:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/"},"wordCount":295,"commentCount":0,"publisher":{"@id":"https:\/\/bhargavs.com\/#\/schema\/person\/28f6d8c9b29f3a879483d65fc2ab5e26"},"keywords":["Exchange 2007","Exchange Management Shell","Exchange Server","Get-MailboxDatabase","Mount-Database","PowerShell"],"articleSection":["Exchange 2007","Exchange Management Shell","Exchange Server","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/","url":"https:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/","name":"Force Mount-Database - Bhargav&#039;s IT Playground","isPartOf":{"@id":"https:\/\/bhargavs.com\/#website"},"datePublished":"2009-05-28T07:06:46+00:00","breadcrumb":{"@id":"https:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/bhargavs.com\/index.php\/2009\/05\/28\/exchange-2007-powershell-force-mount-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bhargavs.com\/"},{"@type":"ListItem","position":2,"name":"Force Mount-Database"}]},{"@type":"WebSite","@id":"https:\/\/bhargavs.com\/#website","url":"https:\/\/bhargavs.com\/","name":"Bhargav's IT Playground","description":"Passion for Technology. Power of Collaboration.","publisher":{"@id":"https:\/\/bhargavs.com\/#\/schema\/person\/28f6d8c9b29f3a879483d65fc2ab5e26"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bhargavs.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/bhargavs.com\/#\/schema\/person\/28f6d8c9b29f3a879483d65fc2ab5e26","name":"Bhargav","logo":{"@id":"https:\/\/bhargavs.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/bhargavs.com"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":166,"url":"https:\/\/bhargavs.com\/index.php\/2009\/09\/16\/bypass-confirmation-prompts-managed-folder-policy\/","url_meta":{"origin":81,"position":0},"title":"How to bypass confirmation prompts for Managed Folder Policy","author":"Bhargav","date":"September 16, 2009","format":false,"excerpt":"When you try to apply managed mailbox folder policy to a mailbox using set-mailbox, you would run a command like this: \u00a0 set-mailbox -identity mailboxA -ManagedFolderMailboxPolicy \"MFPolicy\" \u00a0 This would result in a confirmation prompt \u00a0 Confirm Are you sure you want to perform this action? ... \u00a0 To avoid\u2026","rel":"","context":"In &quot;Exchange 2007&quot;","block_context":{"text":"Exchange 2007","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/exchange-server\/exchange-2007\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":97,"url":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell-2\/","url_meta":{"origin":81,"position":1},"title":"Check Exchange 2003 vitals with PowerShell","author":"Bhargav","date":"June 12, 2009","format":false,"excerpt":"I have written recently about Free System PTEs and \/PAE usage in Exchange 2003 mailbox servers. I set out to write a PowerShell script that will run against given list of servers and report back certain vitals including boot.ini settings, SystemPages registry setting and current performance data for Free Sytem\u2026","rel":"","context":"In &quot;Exchange 2003&quot;","block_context":{"text":"Exchange 2003","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/exchange-server\/exchange-2003\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1679,"url":"https:\/\/bhargavs.com\/index.php\/2012\/05\/03\/exchange-management-shell-error-500-internal-server-error\/","url_meta":{"origin":81,"position":2},"title":"Exchange Management Shell Error 500 &#8211; Internal Server Error","author":"Bhargav","date":"May 3, 2012","format":false,"excerpt":"I have come across this issue enough times that even if it is documented on TechNet it deserves mention here. When you launch Exchange Management Shell or try to connect to an Exchange 2010 Server remotely using PowerShell, you get error \u201c500 \u2013 Internal Server Error. There is a problem\u2026","rel":"","context":"In &quot;Exchange 2010&quot;","block_context":{"text":"Exchange 2010","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/exchange-server\/exchange-2010\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1627,"url":"https:\/\/bhargavs.com\/index.php\/2009\/06\/12\/check-exchange-2003-vitals-powershell\/","url_meta":{"origin":81,"position":3},"title":"Check Exchange 2003 vitals with PowerShell \u2013 Part II","author":"Bhargav","date":"June 12, 2009","format":false,"excerpt":"In continuation to my previous post \u201cCheck Exchange 2003 vitals with PowerShell\u201d, I also have a code block that you can replace if you want to query all exchange servers in your environment dynamically with script instead of using text file as in the code I posted earlier. In the\u2026","rel":"","context":"In &quot;Exchange 2003&quot;","block_context":{"text":"Exchange 2003","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/exchange-server\/exchange-2003\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1651,"url":"https:\/\/bhargavs.com\/index.php\/2010\/04\/07\/how-to-install-update-rollups-remotely-on-exchange-2010-server\/","url_meta":{"origin":81,"position":4},"title":"How to install Update Rollups remotely on Exchange 2010 server","author":"Bhargav","date":"April 7, 2010","format":false,"excerpt":"If you are like me, you are always looking for ways to not leave your chair, or for that matter, not switch windows. When it comes to install Update Rollups on every Exchange 2010 server you have, the same applies. So I set out to find a way and I\u2026","rel":"","context":"In &quot;Exchange 2010&quot;","block_context":{"text":"Exchange 2010","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/exchange-server\/exchange-2010\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1674,"url":"https:\/\/bhargavs.com\/index.php\/2011\/10\/21\/script-to-configure-static-ports-on-exchange-server-2010-2\/","url_meta":{"origin":81,"position":5},"title":"Script to configure static ports on Exchange Server 2010","author":"Bhargav","date":"October 21, 2011","format":false,"excerpt":"There is nothing new about this. If you have been reading about Exchange Server 2010 or have it deployed with hardware load balancer, chances are, you have read how to configure static ports on Exchange Server 2010 on TechNet Social wiki for Exchange 2010. Chances are that you have also\u2026","rel":"","context":"In &quot;Exchange 2010&quot;","block_context":{"text":"Exchange 2010","link":"https:\/\/bhargavs.com\/index.php\/category\/microsoft\/exchange-server\/exchange-2010\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_shortlink":"https:\/\/wp.me\/pkROc-1j","_links":{"self":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/posts\/81","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/comments?post=81"}],"version-history":[{"count":0,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/posts\/81\/revisions"}],"wp:attachment":[{"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/media?parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/categories?post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bhargavs.com\/index.php\/wp-json\/wp\/v2\/tags?post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}