# Maintaining Access

```bash
# Once you have local admin of a local user on a machine,
# you can add a domain account as a local admin as well
net localgroup administrators <user> /add

# Add a new user to the domain and add an existing domain user to the "Domain Admins" group
net user <user> <password> /add /domain 
net group "Domain Admins" <user> /add /domain 

# Remove a user from the group
net localgroup administrators <user> /del 
```


---

# 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://gokulkarthik.gitbook.io/pentesting-checklist/windows-and-active-directory/maintaining-access.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.
