{"id":651,"date":"2016-03-17T11:58:45","date_gmt":"2016-03-17T11:58:45","guid":{"rendered":"https:\/\/www.lieben.nu\/liebensraum\/?p=651"},"modified":"2016-03-17T11:58:45","modified_gmt":"2016-03-17T11:58:45","slug":"finding-unused-accepted-domains-in-exchange-2013","status":"publish","type":"post","link":"https:\/\/lieben.nu\/liebensraum\/2016\/03\/finding-unused-accepted-domains-in-exchange-2013\/","title":{"rendered":"Finding unused accepted domains in Exchange 2013"},"content":{"rendered":"<p>If, for some reason, you want to see which domains in your exchange organisation are not being used (not registered in the ProxyAddresses fields of your users), use below snippet in the Exchange Powershell Module. <\/p>\n<p>Note: this does NOT (yet) check for domains used in Public Folders or Mail Contacts.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\n\n$mailboxes = get-mailbox -Resultsize Unlimited\n$groups = get-distributiongroup -Resultsize Unlimited\n$domains = Get-AcceptedDomain\n$output = @()\n\nforeach ($domain in $domains){\n\n $obj = New-Object PSObject\n $obj | Add-Member NoteProperty domainName($domain.DomainName)\n $obj | Add-Member NoteProperty domainType($domain.DomainType)\n $res = $mailboxes | where-object {$_.EmailAddresses -Match $domain.DomainName}\n if(-not $res){\n $res = $groups | where-object {$_.EmailAddresses -Match $domain.DomainName}\n }\n if($res){\n $obj | Add-Member NoteProperty inUse(&quot;YES&quot;)\n }else{\n $obj | Add-Member NoteProperty inUse(&quot;NO&quot;)\n }\n $output += $obj\n}\n\nWrite-Output $output\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If, for some reason, you want to see which domains in your exchange organisation are not being used (not registered in the ProxyAddresses fields of your users), use below snippet in the Exchange Powershell Module. Note: this does NOT (yet) check for domains used in Public Folders or Mail Contacts. $mailboxes = get-mailbox -Resultsize Unlimited &hellip; <a href=\"https:\/\/lieben.nu\/liebensraum\/2016\/03\/finding-unused-accepted-domains-in-exchange-2013\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Finding unused accepted domains in Exchange 2013<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[15,16,39],"tags":[],"class_list":["post-651","post","type-post","status-publish","format-standard","hentry","category-exchange-2010","category-exchange-2013","category-powershell"],"_links":{"self":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/comments?post=651"}],"version-history":[{"count":0,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/651\/revisions"}],"wp:attachment":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/media?parent=651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/categories?post=651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/tags?post=651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}