> For the complete documentation index, see [llms.txt](https://alham-rizvi.gitbook.io/alhamrizvi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alham-rizvi.gitbook.io/alhamrizvi/active-directory/09.-group-scope.md).

# 09. Group Scope

**Why this matters at all:** AD groups have a **scope** attribute that determines *which domains* their members can come from — this is a separate concept from the group's *type* (security vs distribution).

## The Three Scopes

| Scope            | Can contain members from                             |
| ---------------- | ---------------------------------------------------- |
| **Global**       | Same domain only                                     |
| **Domain Local** | Any trusted domain (including across a forest trust) |
| **Universal**    | Any domain in the forest                             |

## The Practical Consequence

If a privileged group (like a gMSA's authorized-reader group) is scoped as **Global**, you *cannot* add a member from another domain to it — AD will reject the operation outright, even if you have `GenericAll` on the group. You must first convert its scope to Domain Local (or Universal).

## Worked Example

```bash
# groupType values (as signed 32-bit):
#  -2147483646 = Global security group
#  -2147483644 = Domain Local security group
#  -2147483640 = Universal security group

bloodyAD --host dc2.sub.htb -d sub.htb -u 'jane.doe@domain.htb' -k \
  set object 'CN=Sensitive Group,CN=Users,DC=sub,DC=htb' groupType -v '-2147483644'
```

Only *after* this conversion can you successfully add a cross-domain member:

```bash
bloodyAD --host dc2.sub.htb -d sub.htb -u 'jane.doe@domain.htb' -k \
  add groupMember 'CN=Sensitive Group,CN=Users,DC=sub,DC=htb' \
  '<jane.doe-SID>'
```

## Why This Step Exists

Changing a group's scope is itself a privileged, auditable action — which is exactly why it requires the DACL abuse from `08_DACL_Abuse.md` as a prerequisite. It's a small, easy-to-miss step, but without it the cross-domain membership addition simply fails.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://alham-rizvi.gitbook.io/alhamrizvi/active-directory/09.-group-scope.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
