add delegation activedirectory powershell - permission full control

Anonymous
2020-07-16T03:05:04.607+00:00

hello

I need to add full control permission (delegation) on OU in Active Directory to admin group

I understand that the command should be used : set-acl

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-acl?view=powershell-7

But all articles write about authorization folder on a network folder and not users or groups with permission on AD

I want to use poweshell script and I did not find any articles on the subject - thank you for your help

https://social.technet.microsoft.com/Forums/windowsserver/en-US/a1334d72-4e1d-41c9-aa13-3628fd9e6826/add-delegation-activedirectory-powershell-permission-full-control?forum=winserversecurity

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Young Yang (Shanghai Wicresoft Co,.Ltd.) 661 Reputation points
    2020-07-16T06:02:49.62+00:00

    Hi,

    Maybe you can try this :

    $ou = "AD:\OU=test,DC=test,DC=com"

    $group = Get-ADGroup administrators

    $sid = new-object System.Security.Principal.SecurityIdentifier $group.SID

    $acl = get-acl $ou

    $ace = new-object System.DirectoryServices.ActiveDirectoryAccessRule $sid,"GenericAll","Allow"

    $acl.AddAccessRule($ace)

    set-acl -AclObject $acl $ou

    Best wishes,

    Young Yang

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.