{"id":597,"date":"2016-05-29T21:38:03","date_gmt":"2016-05-29T19:38:03","guid":{"rendered":"http:\/\/wp.rimfalt.se\/?p=597"},"modified":"2016-05-29T21:38:03","modified_gmt":"2016-05-29T19:38:03","slug":"clear-out-exchange-settings-in-ad","status":"publish","type":"post","link":"https:\/\/wp.rimfalt.se\/?p=597","title":{"rendered":"Clear out Exchange settings in AD"},"content":{"rendered":"<p>I certanly dont recommend this but this is what worked &#8230;.<\/p>\n<p><code><br \/>\n$User = \"\"<br \/>\n$Users = \"\"<br \/>\n$Users=Get-ADUser -filter * | select SamAccountName<\/p>\n<p>foreach ($User in $Users)<br \/>\n{<br \/>\nset-ADUser -identity $User.SamAccountName -clear legacyExchangeDN<br \/>\nset-ADUser -identity $User.SamAccountName -clear mailNickname<br \/>\nset-ADUser -identity $User.SamAccountName -clear msExchHomeServerName<br \/>\nset-ADUser -identity $User.SamAccountName -clear msExchMailboxGuid<br \/>\nset-ADUser -identity $User.SamAccountName -clear msExchMailBoxSecurityDescriptor<br \/>\nset-ADUser -identity $User.SamAccountName -clear msExchPoliciesIncluded<br \/>\nset-ADUser -identity $User.SamAccountName -clear msExchRBACPolicyLink<br \/>\nset-ADUser -identity $User.SamAccountName -clear msExchRecipientDisplayType<br \/>\nset-ADUser -identity $User.SamAccountName -clear msExchRecipientTypeDetails<br \/>\nset-ADUser -identity $User.SamAccountName -clear msExchTextMessagingState<br \/>\nset-ADUser -identity $User.SamAccountName -clear msExchUMDtmfMap<br \/>\nset-ADUser -identity $User.SamAccountName -clear msExchUserAccountControl<br \/>\nset-ADUser -identity $User.SamAccountName -clear msExchUserCulture<br \/>\nset-ADUser -identity $User.SamAccountName -clear msExchVersion<br \/>\nset-ADUser -identity $User.SamAccountName -clear proxyAddresses<br \/>\nset-ADUser -identity $User.SamAccountName -clear showInAddressBook<br \/>\n}<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I certanly dont recommend this but this is what worked &#8230;. $User = &#8221;&#8221; $Users = &#8221;&#8221; $Users=Get-ADUser -filter * [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[30,49,75],"class_list":["post-597","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-ad","tag-exchange","tag-powershell"],"_links":{"self":[{"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=\/wp\/v2\/posts\/597","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=597"}],"version-history":[{"count":0,"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=\/wp\/v2\/posts\/597\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.rimfalt.se\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}