{"id":110,"date":"2020-01-21T11:46:25","date_gmt":"2020-01-21T11:46:25","guid":{"rendered":"https:\/\/standingtech.com\/randomarticles\/?p=110"},"modified":"2020-01-21T11:50:48","modified_gmt":"2020-01-21T11:50:48","slug":"enable-inheritance-for-bulk-ad-user-active-directory","status":"publish","type":"post","link":"https:\/\/standingtech.com\/randomarticles\/enable-inheritance-for-bulk-ad-user-active-directory\/","title":{"rendered":"Enable inheritance for Bulk Ad User (Active Directory)"},"content":{"rendered":"\n<p>Run below script to enable inheritance for Bulk AD user under specific OU (enable inheritance on all AD user accounts)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ADusers = Get-ADUser -ldapfilter \"(objectclass=user)\" -searchbase \"OU=Students,DC=ukh,DC=edu,DC=krd\"\nForEach($user in $ADusers)\n{\n    # Binding the users to DS\n    $ou = [ADSI](\"LDAP:\/\/\" + $user)\n    $sec = $ou.psbase.objectSecurity\n \n    if ($sec.get_AreAccessRulesProtected())\n    {\n        $isProtected = $false ## allows inheritance\n        $preserveInheritance = $true ## preserver inhreited rules\n        $sec.SetAccessRuleProtection($isProtected, $preserveInheritance)\n        $ou.psbase.commitchanges()\n        Write-Host \"$user is now inherting permissions\";\n    }\n    else\n    {\n        Write-Host \"$User Inheritable Permission already set\"\n    }\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Run below script to enable inheritance for Bulk AD user under specific OU (enable inheritance on all AD user accounts) $ADusers = Get-ADUser -ldapfilter &#8220;(objectclass=user)&#8221; -searchbase &#8220;OU=Students,DC=ukh,DC=edu,DC=krd&#8221; ForEach($user in $ADusers) { # Binding the users to DS $ou = [ADSI](&#8220;LDAP:\/\/&#8221; + $user) $sec = $ou.psbase.objectSecurity if ($sec.get_AreAccessRulesProtected()) { $isProtected = $false ## allows inheritance $preserveInheritance&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-110","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/posts\/110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":3,"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"predecessor-version":[{"id":114,"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/posts\/110\/revisions\/114"}],"wp:attachment":[{"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/standingtech.com\/randomarticles\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}