{"id":7433,"date":"2021-12-13T03:16:01","date_gmt":"2021-12-13T03:16:01","guid":{"rendered":"https:\/\/www.insentragroup.com\/us\/?p=7433"},"modified":"2022-03-30T08:26:19","modified_gmt":"2022-03-30T08:26:19","slug":"directory-remediation-for-active-directory-consolidations","status":"publish","type":"post","link":"https:\/\/www.insentragroup.com\/us\/insights\/geek-speak\/modern-workplace\/directory-remediation-for-active-directory-consolidations\/","title":{"rendered":"Directory Remediation for Active Directory Consolidations"},"content":{"rendered":"\n<p class=\"has-text-align-left\">Mergers and Acquisitions&nbsp;(M&amp;A) are big businesses.&nbsp;Depending on the source, M&amp;A&nbsp;undertakings now total over USD&nbsp;5&nbsp;trillion.&nbsp;Based&nbsp;on the real motive and type,&nbsp;an IT integration plan&nbsp;may be&nbsp; implemented&nbsp;post-signing.&nbsp;<\/p>\n\n\n\nSince Microsoft Active Directory Domain Services (AD DS) underpins the IT infrastructure of many enterprise systems, one common unification often executed post-merger is the consolidation of disparate AD DS. A critical procedure to perform in preparation for an AD DS consolidation is a directory remediation exercise, whereby discovery activities are conducted across both source and destination directories to:\n<br><br>\n\n\n\n<ul class=\"wp-block-list\"><li>Ensure you have a complete picture of every directory&nbsp;<\/li><li>Find conflicts or collisions&nbsp;which&nbsp;exist between directories&nbsp;<\/li><li>Complete a gap analysis between directories&nbsp;<\/li><li>Find anomalies within a given directory&nbsp;<\/li><li>Identity items to remediate&nbsp;<\/li><\/ul>\n\n\n\n<p>AD DS&nbsp;supports&nbsp;Lightweight Directory Access Protocol (LDAP), an application protocol for working with various directory services. Since searching is a fundamental&nbsp;service provided by LDAP,&nbsp;we can take advantage&nbsp;of some built-in, LDAP-query capable,&nbsp;command-line&nbsp;tools Microsoft provides&nbsp;to help us inventory,&nbsp;analyze&nbsp;and compare&nbsp;AD&nbsp;DS&nbsp;objects&nbsp;and their attribute values&nbsp;in preparation for consolidation.&nbsp;These&nbsp;command-line&nbsp;tools&nbsp;are:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>CSVDE.exe<\/li><li>LDIFDE.exe&nbsp;<\/li><\/ul>\n\n\n\n<p>Both\u00a0are available in Windows Server in the\u00a0%windir%system32 folder\u00a0when the\u00a0Remote Server Administration Tools are installed.\u00a0The syntax of these two tools is\u00a0similar, the\u00a0main\u00a0difference being one works with CSV\u00a0(comma-separated value)\u00a0files and one with LDIF\u00a0(LDAP Data Interchange Format)\u00a0files.\u00a0Each\u00a0also has both import and export capabilities.\u00a0<\/p>\n\n\n\n<p>For this article,&nbsp;I will demonstrate only export commands, since this is&nbsp;all&nbsp;we need for&nbsp;object analysis&nbsp;and&nbsp;comparison. Also,&nbsp;all&nbsp;commands&nbsp;will&nbsp;be demonstrated&nbsp;with&nbsp;CSVDE since&nbsp;CSV format files can be read&nbsp;or imported&nbsp;more easily&nbsp;with&nbsp;comparison-capable&nbsp;software, like Microsoft Excel.<\/p>\n\n\n\n<h3 style=\"padding-bottom: 15px;margin-bottom: 30px;margin-top: 40px;border-bottom: 1px solid #F37237;color: #F37237\"><span>OFTEN USED PARAMETERS<\/span><\/h3>\n\n\n\n<p>Although the tools have several useful parameters, I find myself using very few when executing exports, these are:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><td style=\"background-color: #F35905;color: #fff\">Parameter<\/td><td style=\"background-color: #F35905;color: #fff\">Description<\/td><\/tr><\/thead><tbody><tr><td>-f &lt;FileName&gt;<\/td><td>Identifies the import or export file name<\/td><\/tr><tr><td>-s &lt;ServerName&gt;<\/td><td>Specifies the domain controller to perform the import or export operation<\/td><\/tr><tr><td>-d &lt;BaseDN&gt;<\/td><td>Sets the distinguished name of the search base for data export<\/td><\/tr><tr><td>-r &lt;LDAPFilter&gt;<\/td><td>Creates an LDAP search filter for data export<\/td><\/tr><tr><td>-p &lt;Scope&gt;<\/td><td>Sets the search scope. Search scope options are Base, OneLevel, or SubTree<\/td><\/tr><tr><td>-l &lt;LDAPAttributeList&gt;<\/td><td>Sets the list of attributes to return in the results of an export query. LDAP can return attributes in any order, and csvde does not attempt to impose any order on the columns. If you omit this parameter, AD DS returns all attributes<\/td><\/tr><tr><td>-n<\/td><td>Omits the export of binary values<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 style=\"padding-bottom: 15px;margin-bottom: 30px;margin-top: 40px;border-bottom: 1px solid #F37237;color: #F37237\"><span>EXECUTION<\/span><\/h3>\n\n\n\n<p>Note<strong>:<\/strong><strong> <\/strong>&nbsp;&nbsp;&nbsp; All commands should be run from an elevated command prompt on a Windows machine joined to the AD DS being queried. There are ways to execute local commands against external AD DS, however this is beyond the scope of this article<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The following command will export all user objects and any associated attributes which have values. I always like to omit the binary values using the \u2018-n\u2019 parameter since they do not provide any real value and simply bloat the output file<\/li><\/ul>\n\n\n\n<p>csvde -f AllUsers.csv -s DC01.lab.local -d &#8220;dc=lab,dc=local&#8221; -r &#8220;(&amp;(objectClass=user)(objectCategory=person))&#8221; -p Subtree -n<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The following command will export all group objects and any associated attributes which have values<\/li><\/ul>\n\n\n\n<p>csvde -f AllGroups.csv -s DC01.lab.local -d &#8220;dc=lab,dc=local&#8221; -r &#8220;(&amp;(objectClass=group)(objectCategory=group))&#8221; -p Subtree -n<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The following command will export all computer objects and any associated attributes which have values<\/li><\/ul>\n\n\n\n<p>csvde -f AllComputers.csv -s DC01.lab.local -d &#8220;dc=lab,dc=local&#8221; -r &#8220;(&amp;(objectClass=computer)(objectCategory=computer))&#8221; -p Subtree -n<\/p>\n\n\n\n<p>Once you have run the above commands across each AD DS, you can analyze the data to gain valuable insights into a single AD DS or use your favorite comparison tool to compare the output files between multiple AD DS. Useful reports to be generated include:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>How many user, group, or computer objects are in each domain<\/li><li>How many user, group, or computer objects share a common account name between each AD DS<\/li><li>What attributes have invalid or unused values or unsupported characters<\/li><li>Number of disabled user accounts<\/li><li>Number of groups with no members<\/li><li>Computer inventory by operating system version<\/li><\/ul>\n\n\n\n<p>AD DS integrations are complex projects which require careful planning. Directory remediation is just one component of the due diligence needed to be conducted for a successful consolidation program.<\/p>\n\n\n\n<p>For more on the complexities of mergers, acquisitions and divestitures read <a href=\"https:\/\/www.insentragroup.com\/us\/insights\/geek-speak\/migrations\/how-to-prepare-for-microsoft-365-tenant-to-tenant-migration-and-consolidation-projects\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Prepare for Microsoft 365 Tenant to Tenant Migration and Consolidation Projects.<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mergers and Acquisitions\u00a0(M&amp;A) are big businesses.\u00a0Depending on the source,\u00a0M&amp;A\u00a0undertakings\u00a0now total over\u00a0USD\u00a05\u00a0trillion.<\/p>\n","protected":false},"author":117,"featured_media":7436,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[19],"tags":[88,212,60,211,174],"class_list":["post-7433","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-modern-workplace","tag-active-directory","tag-mergers-and-acquisitions","tag-microsoft-365","tag-tenant-to-tenant-migrations","tag-windows-server","entry"],"_links":{"self":[{"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/posts\/7433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/users\/117"}],"replies":[{"embeddable":true,"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/comments?post=7433"}],"version-history":[{"count":13,"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/posts\/7433\/revisions"}],"predecessor-version":[{"id":8927,"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/posts\/7433\/revisions\/8927"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/media\/7436"}],"wp:attachment":[{"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/media?parent=7433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/categories?post=7433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/tags?post=7433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}