{"id":8173,"date":"2021-02-15T10:35:30","date_gmt":"2021-02-15T15:35:30","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=8173"},"modified":"2021-02-15T10:35:34","modified_gmt":"2021-02-15T15:35:34","slug":"climbing-trees-in-powershell","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/","title":{"rendered":"Climbing Trees in PowerShell"},"content":{"rendered":"\n<p>I'm continuing with my renewed interest in Active Directory, and how I can take advantage of PowerShell. This is a topic I've been working with since the PowerShell v2 days. I have <em>a lot<\/em> of old code. Some of which I've decided to dust off and polish up. One topic that always interested me, is displaying a visual representation, or a tree, of an Active Directory Domain.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Listing OrganizationalUnits<\/h2>\n\n\n\n<p>Listing your OUs isn't especially difficult.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Get-ADOrganizationalUnit\u00a0-Filter\u00a0*\u00a0-Properties\u00a0canonicalname\u00a0|\u00a0Sort-Object\u00a0-property\u00a0canonicalname\u00a0|\u00a0Select-object\u00a0-property\u00a0CanonicalName<\/code><\/pre>\n\n\n\n<p>The reason I'm including the canonical name, is to make it easier to sort in a hierarchical fashion.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort.png\"><img loading=\"lazy\" decoding=\"async\" width=\"794\" height=\"861\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort.png\" alt=\"\" class=\"wp-image-8174\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort.png 794w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort-277x300.png 277w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort-768x833.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort-300x325.png 300w\" sizes=\"auto, (max-width: 794px) 100vw, 794px\" \/><\/a><\/figure>\n\n\n\n<p>It is easy enough to change the display to use the distinguished name.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Get-ADOrganizationalUnit\u00a0-Filter\u00a0*\u00a0-Properties\u00a0canonicalname\u00a0|\u00a0Sort-Object\u00a0-property\u00a0canonicalname\u00a0|\u00a0Select-object\u00a0-property\u00a0DistinguishedName<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort-dn.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1022\" height=\"1024\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort-dn-1022x1024.png\" alt=\"\" class=\"wp-image-8175\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort-dn-1022x1024.png 1022w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort-dn-300x301.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort-dn-150x150.png 150w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort-dn-768x769.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort-dn-850x852.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort-dn.png 1052w\" sizes=\"auto, (max-width: 1022px) 100vw, 1022px\" \/><\/a><\/figure>\n\n\n\n<p>But really this is just a list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Showing a Hierarchy<\/h2>\n\n\n\n<p>What I'm missing is a visual representation of the child organizational units. One approach I can take is to start with the root level OUs in the domain, and recursively get the child OUs. I can then format the children to reflect the hierarchy. I can still use Get-ADOrganzationalUnit, but with a few changes.<\/p>\n\n\n\n<p>Here's a parameterized scriptblock.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$get\u00a0=\u00a0{param([string]$path,[int]$indent\u00a0=\u00a02)\n\u00a0\u00a0$ous\u00a0=\u00a0Get-ADOrganizationalUnit\u00a0-Filter\u00a0*\u00a0-Properties\u00a0canonicalname\u00a0-SearchBase\u00a0$path\u00a0-SearchScope\u00a0OneLevel\n\u00a0\u00a0foreach\u00a0($child\u00a0in\u00a0$ous)\u00a0{\n\u00a0\u00a0\u00a0\u00a0$tab\u00a0=\u00a0\"-\"\u00a0*\u00a0$indent\n\u00a0\u00a0\u00a0\u00a0\"|{0}\u00a0{1}\"\u00a0-f\u00a0$tab,\u00a0$child.name\n\u00a0\u00a0\u00a0\u00a0&amp;$get\u00a0-path\u00a0$child.distinguishedname\u00a0-indent\u00a0($indent+=2)\n\u00a0\u00a0\u00a0\u00a0$indent-=2\n\u00a0\u00a0}\n}<\/code><\/pre>\n\n\n\n<p>The script block is getting all OUs in the given location, as specified by the SearchBase parameter. And it is only getting OUs in the current level. That's the SearchScope parameter of OneLevel. I don't want it to recurse. Then for each child I'm building a string with the OU name that is indented to reflect the hierarchy. <\/p>\n\n\n\n<p>I'll run this from the root domain.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">(Get-ADDomain).Name;invoke-command\u00a0$get\u00a0-ArgumentList\u00a0\"DC=company,dc=pri\"<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/basic-outree.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"824\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/basic-outree-1024x824.png\" alt=\"\" class=\"wp-image-8176\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/basic-outree-1024x824.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/basic-outree-300x241.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/basic-outree-768x618.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/basic-outree-850x684.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/basic-outree.png 1318w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>And it would be simple enough to change the code to display the distinguishedname.<\/p>\n\n\n\n<p>This is a pretty good start, but you know I'm going to see how far I can take this.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Show-Domain<\/h2>\n\n\n\n<p>I want an easy command to run from a console prompt to generate a domain tree. This means I'll need to write a function. The other change, and this is a major one, is that after discussing this with my friend Gladys Kravitz, I realized there might be times when I also want to include containers like CN=Users.<\/p>\n\n\n\n<p>To get containers, I can't use Get-ADOrganizationalUnit. There is no corresponding container command, but I can use Get-ADObject. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Get-ADObject -ldapfilter \"objectclass=container\"<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-adcontainers.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"231\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-adcontainers-1024x231.png\" alt=\"\" class=\"wp-image-8177\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-adcontainers-1024x231.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-adcontainers-300x68.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-adcontainers-768x174.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-adcontainers-1536x347.png 1536w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-adcontainers-850x192.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-adcontainers.png 1956w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>By the way, I could also have written this with this filtering syntax.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Get-ADObject -filter \"objectclass -eq 'container'\"<\/code><\/pre>\n\n\n\n<p>There's really not much difference between the two.<\/p>\n\n\n\n<p>By default my function will only display organizational units, but if I specify a parameter to show containers, I'll need to modify my LDAP filter accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">if\u00a0($Containers)\u00a0{\n\u00a0\u00a0\u00a0\u00a0$filter\u00a0=\u00a0\"(|(objectclass=container)(objectclass=organizationalUnit))\"\n\u00a0\u00a0}\n\u00a0\u00a0else\u00a0{\n\u00a0\u00a0\u00a0\u00a0$filter\u00a0=\u00a0\"objectclass=organizationalUnit\"\n\u00a0\u00a0}<\/code><\/pre>\n\n\n\n<p>My function can then format each child and display indented and with special characters to show tree \"branches\". I also decided to take advantage of ANSI and show items in different colors.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">if\u00a0($_.ProtectedFromAccidentalDeletion)\u00a0{\n\u00a0\u00a0\u00a0\u00a0<em>#display\u00a0protected\u00a0OUs\u00a0in\u00a0color<\/em>\n\u00a0\u00a0\u00a0\u00a0$nameValue\u00a0=\u00a0\"$([char]0x1b)[38;5;199m$name$([char]0x1b)[0m\"\n}\nelseif\u00a0($_.objectclass\u00a0-eq\u00a0'container')\u00a0{\n\u00a0\u00a0\u00a0\u00a0$nameValue\u00a0=\u00a0\"$([char]0x1b)[38;5;3m$name$([char]0x1b)[0m\"\n}\nelseif\u00a0($_.objectclass\u00a0-ne\u00a0'organizationalUnit')\u00a0{\n\u00a0\u00a0\u00a0\u00a0<em>#display\u00a0non-OU\u00a0and\u00a0non-Container\u00a0in\u00a0a\u00a0different\u00a0color<\/em>\n\u00a0\u00a0\u00a0\u00a0$nameValue\u00a0=\u00a0\"$([char]0x1b)[38;5;211m$name$([char]0x1b)[0m\"\n}\nelse\u00a0{\n\u00a0\u00a0\u00a0\u00a0$nameValue\u00a0=\u00a0\"$([char]0x1b)[38;5;191m$name$([char]0x1b)[0m\"\n}<\/code><\/pre>\n\n\n\n<p>Here's what it looks like.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/show-domaintree.png\"><img loading=\"lazy\" decoding=\"async\" width=\"563\" height=\"1024\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/show-domaintree-563x1024.png\" alt=\"\" class=\"wp-image-8178\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/show-domaintree-563x1024.png 563w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/show-domaintree-165x300.png 165w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/show-domaintree-300x545.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/show-domaintree.png 759w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/a><\/figure>\n\n\n\n<p>I can display containers if I want, and I can also use distinguishedname output.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/show-domaintree2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"985\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/show-domaintree2-1024x985.png\" alt=\"\" class=\"wp-image-8179\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/show-domaintree2-1024x985.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/show-domaintree2-300x289.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/show-domaintree2-768x739.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/show-domaintree2-850x818.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/show-domaintree2.png 1374w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>I should point out that this is not an all-inclusive domain tree. I'm filtering out containers with GUID-based names that are under CN=Operations,CN=DomainUpdates,CN=System.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/operations-containers.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"183\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/operations-containers-1024x183.png\" alt=\"\" class=\"wp-image-8181\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/operations-containers-1024x183.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/operations-containers-300x54.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/operations-containers-768x137.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/operations-containers-1536x274.png 1536w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/operations-containers-850x152.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/operations-containers.png 1977w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>I personally didn't see any value in including them in the output.<\/p>\n\n\n\n<p>The function writes strings to the pipeline, so you can pipe to Out-File. The file contents will include escape characters. Which is great because you and use Get-Content on the file to re-display the colorized tree.<\/p>\n\n\n\n<p>You need to run the function in a PowerShell host that supports ANSI and extended characters. You'll most likely get poor results in the PowerShell ISE or VS Code.<\/p>\n\n\n\n<p>I've posted the function  on GitHub as a gist at <a href=\"https:\/\/gist.github.com\/jdhitsolutions\/895d44d68ac4f9523257393d9d4a38d8\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/gist.github.com\/jdhitsolutions\/895d44d68ac4f9523257393d9d4a38d8<\/a><\/p>\n\n\n\n<p>The function will let you specify a domain controller and supports alternate credentials. It requires that you have the ActiveDirectory module installed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Bonus<\/h2>\n\n\n\n<p>As I mentioned, I've been scripting with PowerShell and Active Directory for a long time. Here is a function that uses ADSI and the DirectoryServices .NET classes to build a domain tree. This function does NOT require the Active Directory module.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">Function\u00a0Get-DSTree\u00a0{\n\u00a0\u00a0[cmdletbinding()]\n\u00a0\u00a0[OutputType(\"string\")]\n\u00a0\u00a0Param(\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[ADSI]$ADSPath=\"LDAP:\/\/DC=company,DC=Pri\",\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0[int]$Indent=0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0)\n\n\u00a0\u00a0[string]$leader=\"\u00a0\"\n\u00a0\u00a0[int]$pad\u00a0=\u00a0$leader.length+$indent\n\n\u00a0\u00a0$searcher\u00a0=\u00a0New-Object\u00a0directoryservices.directorysearcher\n\u00a0\u00a0$searcher.pagesize=100\n\u00a0\u00a0<em>#get\u00a0containers\u00a0and\u00a0OUs<\/em>\n\u00a0\u00a0<em>#$searcher.Filter\u00a0=\u00a0\"(|(objectclass=container)(objectclass=organizationalUnit))\"<\/em>\n\n\u00a0\u00a0<em>#get\u00a0only\u00a0OUs<\/em>\n\u00a0\u00a0$Searcher.filter\u00a0=\u00a0\"(&amp;(objectclass=organizationalUnit))\"\n\u00a0\u00a0$searcher.searchScope=\"OneLevel\"\n\u00a0\u00a0$searcher.searchRoot\u00a0=\u00a0$ADSPath\n\u00a0\u00a0[void]$searcher.PropertiesToLoad.Add(\"DistinguishedName\")\n\n\u00a0\u00a0$searcher.FindAll()\u00a0|\u00a0ForEach-Object\u00a0{\n\u00a0\u00a0\u00a0$branch\u00a0=\u00a0\"{0}{1}\"\u00a0-f\u00a0($leader.Padleft($pad,$leader),$_.properties.distinguishedname[0])\n\u00a0\u00a0\u00a0$branch\n\u00a0\u00a0\u00a0\u00a0Get-DSTree\u00a0-ADSPath\u00a0$_.path\u00a0-indent\u00a0($pad+2)\n\u00a0\u00a0}\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-dstree.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"922\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-dstree-1024x922.png\" alt=\"\" class=\"wp-image-8183\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-dstree-1024x922.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-dstree-300x270.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-dstree-768x692.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-dstree-850x766.png 850w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/get-dstree.png 1149w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>I have a few more ideas related to this topic so be sure to follow me on <a href=\"https:\/\/twitter.com\/jeffhicks\" target=\"_blank\" rel=\"noreferrer noopener\">Twitter <\/a>or subscribe so you don't miss out.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m continuing with my renewed interest in Active Directory, and how I can take advantage of PowerShell. This is a topic I&#8217;ve been working with since the PowerShell v2 days. I have a lot of old code. Some of which I&#8217;ve decided to dust off and polish up. One topic that always interested me, is&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"New on the blog: Climbing Trees in #PowerShell","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[539,39,534,540],"class_list":["post-8173","post","type-post","status-publish","format-standard","hentry","category-active-directory","tag-active-directory","tag-adsi","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Climbing Trees in PowerShell &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"Some ideas and PowerShell code for displaying an Active Domain tree in the console, including both OUs and containers if you want.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Climbing Trees in PowerShell &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Some ideas and PowerShell code for displaying an Active Domain tree in the console, including both OUs and containers if you want.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-15T15:35:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-15T15:35:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/active-directory\\\/8173\\\/climbing-trees-in-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/active-directory\\\/8173\\\/climbing-trees-in-powershell\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Climbing Trees in PowerShell\",\"datePublished\":\"2021-02-15T15:35:30+00:00\",\"dateModified\":\"2021-02-15T15:35:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/active-directory\\\/8173\\\/climbing-trees-in-powershell\\\/\"},\"wordCount\":692,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/active-directory\\\/8173\\\/climbing-trees-in-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/canonical-ou-sort.png\",\"keywords\":[\"Active Directory\",\"ADSI\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"Active Directory\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/active-directory\\\/8173\\\/climbing-trees-in-powershell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/active-directory\\\/8173\\\/climbing-trees-in-powershell\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/active-directory\\\/8173\\\/climbing-trees-in-powershell\\\/\",\"name\":\"Climbing Trees in PowerShell &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/active-directory\\\/8173\\\/climbing-trees-in-powershell\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/active-directory\\\/8173\\\/climbing-trees-in-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/canonical-ou-sort.png\",\"datePublished\":\"2021-02-15T15:35:30+00:00\",\"dateModified\":\"2021-02-15T15:35:34+00:00\",\"description\":\"Some ideas and PowerShell code for displaying an Active Domain tree in the console, including both OUs and containers if you want.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/active-directory\\\/8173\\\/climbing-trees-in-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/active-directory\\\/8173\\\/climbing-trees-in-powershell\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/active-directory\\\/8173\\\/climbing-trees-in-powershell\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/canonical-ou-sort.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/canonical-ou-sort.png\",\"width\":794,\"height\":861},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/active-directory\\\/8173\\\/climbing-trees-in-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Active Directory\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/active-directory\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Climbing Trees in PowerShell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Climbing Trees in PowerShell &#8226; The Lonely Administrator","description":"Some ideas and PowerShell code for displaying an Active Domain tree in the console, including both OUs and containers if you want.","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:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Climbing Trees in PowerShell &#8226; The Lonely Administrator","og_description":"Some ideas and PowerShell code for displaying an Active Domain tree in the console, including both OUs and containers if you want.","og_url":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/","og_site_name":"The Lonely Administrator","article_published_time":"2021-02-15T15:35:30+00:00","article_modified_time":"2021-02-15T15:35:34+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Climbing Trees in PowerShell","datePublished":"2021-02-15T15:35:30+00:00","dateModified":"2021-02-15T15:35:34+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/"},"wordCount":692,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort.png","keywords":["Active Directory","ADSI","PowerShell","Scripting"],"articleSection":["Active Directory"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/","url":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/","name":"Climbing Trees in PowerShell &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort.png","datePublished":"2021-02-15T15:35:30+00:00","dateModified":"2021-02-15T15:35:34+00:00","description":"Some ideas and PowerShell code for displaying an Active Domain tree in the console, including both OUs and containers if you want.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/canonical-ou-sort.png","width":794,"height":861},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8173\/climbing-trees-in-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Active Directory","item":"https:\/\/jdhitsolutions.com\/blog\/category\/active-directory\/"},{"@type":"ListItem","position":2,"name":"Climbing Trees in PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":37,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/37\/get-active-directory-user-information-in-powershell\/","url_meta":{"origin":8173,"position":0},"title":"Get Active Directory User Information in PowerShell","author":"Jeffery Hicks","date":"July 5, 2006","format":false,"excerpt":"One feature that PowerShell will likely be missing when it first ships is solid support for ADSI and working with Active Directory. You can use .NET DirectoryEntry objects but it feels more like programming and less like scripting. Another option for working with Active Directory in PowerShell is to use\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8400,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8400\/friday-fun-custom-grouping-with-powershell\/","url_meta":{"origin":8173,"position":1},"title":"Friday Fun &#8211; Custom Grouping with PowerShell","author":"Jeffery Hicks","date":"May 14, 2021","format":false,"excerpt":"The other day I was answering a question in the PowerShell Facebook group. This person was getting data from Active Directory and trying to organize the results in a way that met his business requirements. My suggestion was to use Group-Object and a custom grouping property. I am assuming you\u2026","rel":"","context":"In &quot;Active Directory&quot;","block_context":{"text":"Active Directory","link":"https:\/\/jdhitsolutions.com\/blog\/category\/active-directory\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/custom-grouping.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/custom-grouping.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/custom-grouping.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/custom-grouping.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1885,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1885\/updating-multi-valued-active-directory-properties-part-1\/","url_meta":{"origin":8173,"position":2},"title":"Updating Multi-Valued Active Directory Properties Part 1","author":"Jeffery Hicks","date":"December 8, 2011","format":false,"excerpt":"Yesterday on Twitter, I got a tweet from @Docsmooth regarding how to update a multivalued property in Active Directory. There are a number of ways to handle this, especially from PowerShell naturally, so I tweeted one way in a series of tweets. But that's a hard way to learn something,\u2026","rel":"","context":"In &quot;Active Directory&quot;","block_context":{"text":"Active Directory","link":"https:\/\/jdhitsolutions.com\/blog\/category\/active-directory\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8916,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8916\/managing-raw-directorysearcher-data\/","url_meta":{"origin":8173,"position":3},"title":"Managing Raw DirectorySearcher Data","author":"Jeffery Hicks","date":"February 24, 2022","format":false,"excerpt":"Recently, I was chatting with my friend Gladys. As part of her work, she often creates Active Directory PowerShell-related tools for her colleagues. It is always good to be the toolmaker! Anyway, she doesn't want to rely on the Active Directory module from Remote Server Administration Tools (RSAT). There's no\u2026","rel":"","context":"In &quot;Active Directory&quot;","block_context":{"text":"Active Directory","link":"https:\/\/jdhitsolutions.com\/blog\/category\/active-directory\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/02\/resultpropertiescollection.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/02\/resultpropertiescollection.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/02\/resultpropertiescollection.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/02\/resultpropertiescollection.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":8185,"url":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/8185\/scaling-the-active-directory-log-search-with-powershell\/","url_meta":{"origin":8173,"position":4},"title":"Scaling the Active Directory Log Search with PowerShell","author":"Jeffery Hicks","date":"February 16, 2021","format":false,"excerpt":"Recently, I posted a demonstration of how to find changes to your Active Directory using PowerShell. This process requires that you search through the Security event log on all your domain controllers. As a few people pointed out, myself included, this has the potential to not scale very well in\u2026","rel":"","context":"In &quot;Active Directory&quot;","block_context":{"text":"Active Directory","link":"https:\/\/jdhitsolutions.com\/blog\/category\/active-directory\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/02\/pexels-shuxuan-cao-4432160.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":6465,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6465\/keeping-git-in-check-with-powershell\/","url_meta":{"origin":8173,"position":5},"title":"Keeping Git in Check with PowerShell","author":"Jeffery Hicks","date":"January 28, 2019","format":false,"excerpt":"Last week on Twitter I saw a discussion about a git related problem. The short version of the story is that the person was running out of disk space and didn't understand why. Turns out this person has several development projects using git. All of the change tracking and other\u2026","rel":"","context":"In &quot;Git&quot;","block_context":{"text":"Git","link":"https:\/\/jdhitsolutions.com\/blog\/category\/git\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-26.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-26.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-26.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/01\/image_thumb-26.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=8173"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8173\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=8173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=8173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=8173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}