{"id":5302,"date":"2026-06-29T16:06:31","date_gmt":"2026-06-29T16:06:31","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=5302"},"modified":"2026-06-29T16:06:32","modified_gmt":"2026-06-29T16:06:32","slug":"find-exchange-mailbox-users-via-homemdb-attribute","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=5302","title":{"rendered":"Find Exchange Mailbox Users via homeMDB Attribute"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">We were completing a migration from Exchange 2016 to Exchange SE, and we found that when attempting to decommission the old Exchange Servers that we could not due to user accounts referring within the homeMDB attribute to a mailbox database on a legacy Exchange 2016 server. In some cases these didn&#8217;t actually have a mailbox that showed up when you ran &#8220;Get-Mailbox&#8221; within PowerShell; but would obviously block any removal of an Exchange Server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can therefore use something like the following, updating the DN as required for your environment and database name.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-ADUser -filter {homeMDB -eq \"CN=DB1,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=MyCompany,CN=\nMicrosoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=com\"} -Properties * | Select-Object CN,samAccountName,WhenCreated,homeMDB | Format-Table<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also add in a particular search base also if you need:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-ADUser -filter {homeMDB -eq \"CN=DB1,CN=Databases,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=MyCompany,CN=\nMicrosoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=com\"} -SearchBase \"OU=People,OU=Myplace,DC=domain,DC=com\" -Properties * | Select-Object CN,samAccountName,WhenCreated,homeMDB | Format-Table<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>We were completing a migration from Exchange 2016 to Exchange SE, and we found that when attempting to decommission the old Exchange Servers that we could not due to user accounts referring within the homeMDB attribute to a mailbox database on a legacy Exchange 2016 server. In some cases these didn&#8217;t actually have a mailbox &#8230; <a title=\"Find Exchange Mailbox Users via homeMDB Attribute\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=5302\" aria-label=\"Read more about Find Exchange Mailbox Users via homeMDB Attribute\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":4367,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,32,14],"tags":[],"class_list":["post-5302","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-active-directory","category-microsoft-exchange","category-microsoft-windows"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/5302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5302"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/5302\/revisions"}],"predecessor-version":[{"id":5303,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/5302\/revisions\/5303"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/media\/4367"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}