Admin Power Level: Intermediate Chapter 11: Manage People, Computers, and Names

Organisational units and groups

Organisational units organise objects inside a domain, and groups collect users so permissions can be given once, to the group, instead of to each user.

Lesson 5 of 6 in Chapter 11: Manage People, Computers, and Names. Previous step in this path: RootDSE and why DCPromo fails. 3 learning objectives, 6 examples, and a knowledge check.

Start: what you will learn

Organisational units organise objects inside a domain, and groups collect users so permissions can be given once, to the group, instead of to each user.

Learning objectives

  • Create an OU with New-ADOrganizationalUnit
  • Create a group with New-ADGroup
  • Explain why groups beat direct user permissions

Concept in simple words

What it is: An organisational unit, called an OU, is a container inside a domain that organises users and computers, and a group is a collection of users, computers, or other groups that lets you give permissions once, to the group, instead of to each person.

Why it works

Why it works this way: OUs give you a clear structure for delegation, which means letting someone manage one part of the directory, and for Group Policy, which is the system that applies settings to users and computers. Groups work differently, because permissions are attached to the group, and membership decides who gets them, so when someone changes role, you only change their membership, not every permission on every resource.

Think of it like this

Think of it like this: An OU is like a labelled drawer in a filing cabinet, where you put related files so you can find them and manage them together. A group is like a team list pinned to a door, where everyone on the list gets in, and you change access by adding or removing a name from the list, not by changing the lock.

How it works, step by step

How it works, step by step: First, create an OU with New-ADOrganizationalUnit, giving it a Name and a Path, where the Path is the distinguished name, which is the full directory path, of the parent container. OUs are often nested, such as an IT OU inside a Departments OU, so the Path points at the parent, not at the new OU itself.

Next, create a group with New-ADGroup, giving it a Name, a GroupScope such as Global or Universal, which controls how widely the group can be used, a GroupCategory such as Security, which means it can carry permissions, and a Path inside an OU. Then add members to the group, and give permissions to the group, not to single users one by one. This work needs a proper server environment, the Active Directory module, and the right permissions, and it is not a task for a normal workstation.

Let us walk through an example: In New-ADGroup -Name "SalesTeam" -GroupScope Global -GroupCategory Security -Path "OU=Sales,DC=example,DC=local", each part has a job, the name, the scope, the category, and the OU path where the group will live. Look for a success message, then read the group back to confirm it landed in the Sales OU, because a group in the wrong OU is easy to create and annoying to find later.

When to use it

When to use it, and when not to: Use OUs to organise objects and to give a clear target for delegation and policy, and use groups, built around roles, to carry permissions. Do not confuse the two, do not give permissions directly to single users when a role group would do, and do not create a flat pile of tiny groups for every single file, because that pile becomes unmanageable fast.

Start from zero, with two different jobs: Imagine a school with classrooms and clubs. Classrooms decide where a student sits and which rules apply to that room. Clubs decide who gets into the club room, no matter which classroom they sit in. In Active Directory, OUs are the classrooms, and groups are the clubs. An OU decides structure, delegation, and policy targets. A group decides membership, and permissions follow membership. Mixing those two jobs up is the most common design mistake in this whole chapter.

How to read a distinguished name: A distinguished name is read from the most specific part on the left to the broadest part on the right. In OU=Sales,DC=example,DC=local, OU=Sales is the container itself, and DC=example,DC=local is the domain root. In OU=IT,OU=Departments,DC=example,DC=local, the IT OU sits inside the Departments OU, which sits inside the domain. When you write a -Path, you name the parent, not the new object itself, so the -Path for a new IT OU inside Departments is OU=Departments,DC=example,DC=local, and the -Name is IT. Getting that parent step wrong is how objects land in the wrong place.

Let us walk through a nested OU, part by part: In New-ADOrganizationalUnit -Name "IT" -Path "OU=Departments,DC=example,DC=local", -Name is the new OU, and -Path is the full distinguished name of its parent. The result is OU=IT,OU=Departments,DC=example,DC=local. Read it back with Get-ADOrganizationalUnit, and check the full distinguished name, not just the short name, because two OUs can share a short name in different parents, and only the full path tells you which one you actually created.

Delegation, in plain words: Delegation means giving someone permission to manage one part of the directory, without giving them power over the whole domain. An OU is a natural delegation boundary, because you can say this team manages the Sales OU, and nothing outside it. Without OUs, delegation would be a messy list of single objects. With OUs, delegation follows the structure you designed, and a new user in the Sales OU is automatically inside the area that the Sales team manages.

Group scope, in plain words: GroupScope has three values, and each one answers a different question about reach. Global groups are built for users and computers from one domain, and they are the usual home for role membership inside that domain. Universal groups can hold members from across a forest, and they are useful when a role spans domains. DomainLocal groups are used for access inside their own domain, often as the group that actually gets permission on a resource in that domain. Do not memorise the labels alone. Ask first, who are the members, and where will this group be used, and the scope choice usually follows from those two answers.

Group category, and why it matters: GroupCategory has two values. Security groups can carry permissions, so they are the groups you use when access is the goal. Distribution groups are for mailing lists, and they do not carry permissions in the same way, so a distribution group will not open a door no matter how many members it has. If a group is meant to control access, it must be a security group. If you create the wrong category, do not just add members and hope, because membership in the wrong kind of group will not give the access you planned.

Let us walk through membership, part by part: Add-ADGroupMember -Identity "SalesTeam" -Members izaz, maria adds two members at once, because -Members takes a list, with names separated by commas. Get-ADGroupMember -Identity "SalesTeam" then reads the direct members back. Add -Recursive to Get-ADGroupMember when groups are nested inside groups, because -Recursive expands nested groups and shows the users inside them as well, instead of showing only the nested group name. That expanded view is the only honest way to answer the question, who really gets in through this group.

Warning, before you remove a member or a group: Remove-ADGroupMember changes who can use a resource, so check membership first, confirm the exact group and the exact member, and only then remove. A removed member loses access at once, and if that member was the only administrator of a resource, you may lock everyone out until someone with higher permission fixes it. The same care applies to groups themselves. Removing a group removes access for every member at once, so a group removal is never a small cleanup, it is an access change for a whole role.

Warning, before you delete an OU: An OU can hold users, computers, groups, and child OUs, and deleting it affects everything inside it. OUs are also often protected from accidental deletion, which means a plain removal fails with a protection error, and that failure is a safety feature, not a bug. To delete a protected OU, first clear the protection with Set-ADOrganizationalUnit -Identity "OU=Sales,DC=example,DC=local" -ProtectedFromAccidentalDeletion $false, then remove it, and if it still holds children, add -Recursive. Only do this in your own lab domain, with permission, after you have read the OU contents and confirmed nothing inside it is still needed.

A simple design rule you can reuse: Build OUs around structure, such as departments and locations, build groups around roles, such as SalesTeam or ITAdmins, and give permissions to role groups, not to single users and not to single files. When a person changes role, change their group membership once, and their access follows. When a person leaves, remove them from their groups, and disable the account, and their access ends everywhere at once, without hunting through every resource.

Worked examples

Read each example in order. Each one explains its parts, then shows what to look for in the output.

Syntax

Syntax
New-ADOrganizationalUnit -Name <Name> -Path <ParentDN>

Example 1

Creates a Sales OU at the domain root. Nested OUs use the parent OU distinguished name as the path.

Example 1
New-ADOrganizationalUnit -Name "Sales" -Path "DC=example,DC=local"

Illustrative output: OU Sales created.

Example 2

Creates a global security group in the Sales OU, ready for permissions and members.

Example 2
New-ADGroup -Name "SalesTeam" -GroupScope Global -GroupCategory Security -Path "OU=Sales,DC=example,DC=local"

Illustrative output: Group SalesTeam created.

Example 3

The first line adds the user izaz to the SalesTeam group, where -Identity names the group and -Members names who to add. The second line reads the group membership back, and Select-Object Name shows only the member names, so you can confirm the add worked. Adding a member changes the directory, so this needs a proper server environment, the ActiveDirectory module, and permission to change group membership.

Example 3
Add-ADGroupMember -Identity "SalesTeam" -Members izaz
Get-ADGroupMember -Identity "SalesTeam" | Select-Object Name

Illustrative output: Name ---- Izaz Haider

Example 4

A read only list of OUs. DistinguishedName shows the full path, so you can tell two OUs with the same short name apart, and you can copy the exact parent path for your next creation.

Example 4
Get-ADOrganizationalUnit -Filter * | Select-Object Name, DistinguishedName

Illustrative output: Name DistinguishedName ---- ----------------- Sales OU=Sales,DC=example,DC=local

Example 5

Reads group membership with nested groups expanded, so you see the real users, not just a nested group name. objectClass tells you whether each member is a user, a computer, or another group.

Example 5
Get-ADGroupMember -Identity "SalesTeam" -Recursive | Select-Object Name, objectClass

Illustrative output: Name objectClass ---- ----------- Izaz Haider user

Example 6

Warning: this removes access for that member at once, so use it only in your own lab domain, with permission, and only after you have read the membership back and confirmed the exact group and member. -Confirm asks you to confirm before it acts.

Example 6
Remove-ADGroupMember -Identity "SalesTeam" -Members izaz -Confirm

Illustrative output: Member izaz removed from SalesTeam.

Nothing on this page executes PowerShell code. The outputs above are illustrative only.

Common mistakes and troubleshooting

Read these before you try the examples, so you can spot the same problems in your own work.

  • Confusing an OU with a group. OUs organise and apply policy. Groups collect members for permissions.
  • Creating flat groups for every tiny task, which becomes unmanageable. Design groups around roles, not single files.
  • Creating a group and giving it permissions, but forgetting to add any members to it, then wondering why nobody can use the resource, when the group itself is empty.
  • Typing -GroupName for Add-ADGroupMember or Get-ADGroupMember, when the real parameter is -Identity, so the command fails before it does anything.
  • Writing the new OU name in the -Path instead of the parent path, so the object lands in the wrong place, or the creation fails because the parent path does not exist.
  • Deleting a protected OU and treating the protection error as a permission failure, when the fix is to clear ProtectedFromAccidentalDeletion first, after checking the OU contents, and only in your own lab domain, with permission.
  • Removing a group, or the last administrator, without checking membership first, and locking a whole role out of a resource at once.

Knowledge check

Knowledge check

What is an OU mainly for?

Pick one answer. Feedback appears right away, and you can try again.

Remember this and next step

Remember this: OUs organise and target policy, groups collect members for permissions, and good design means roles, not single files, and membership changes, not permission rewrites.

Next step: DNS records and zones