Group Policy and domain resources¶
Practical 6.6 group-policy-and-domain-resources-annex.pdf · PDF
The school PCs all show the same wallpaper, block the same settings and map the same network drive. Nobody walks round every morning to set them. So who does?
You already changed a setting in the local security policy of win11: a warning text on the sign-in screen. Now Aina, the boss, wants that warning on every PC of Tramuntana Apps. Twelve PCs, twelve times by hand. Next month she changes one word: twelve times again. A domain is not only one list of users. It is also one place to write the rules: you write the rule once, on the server, and every PC comes to read it.
What you will learn
- What a Group Policy Object (GPO) is and why a domain needs it
- Create a GPO, link it to an OU and check on a client that it arrived (
gpupdate,gpresult) - Tell computer settings from user settings and predict who receives a GPO
- Put the levels in order — local, site, domain, OU — and say which one wins
- Give a domain group access to a shared folder and prove who gets in and who does not
- Why "Group Policy is for groups" is a trap
A rule sheet on a door¶
Think of the office building again. A GPO is a rule sheet pinned on a door: whoever walks through that door follows it. A sheet on the main entrance is for everybody; a sheet on the Design room door is only for Design.
A Group Policy Object (GPO) is a named set of settings stored in the domain. You link it to a place in the directory, and every computer and user below that place applies it.
Two halves of every sheet¶
| Computer Configuration | User Configuration | |
|---|---|---|
| Applies to | The PC, whoever sits at it | The person, on whatever PC |
| Applied when | The PC starts | The user logs in |
| Follows the OU of | The computer account | The user account |
When do PCs read the sheets?¶
Clients ask the DC again in the background every 90 minutes, plus a random 0–30 minutes, so that all PCs do not ask at the same moment. When you do not want to wait:
gpupdate /force applies the GPOs now. gpresult /r shows which GPOs were applied to this computer and this user. User settings and group membership are read at login, so after changing them, sign out and in.
Careful: Group Policy is not for groups
The name misleads. A GPO is linked to a site, a domain or an OU — never to a group. Groups open resources; OUs receive rules.
Your first GPOs¶
The tool is Group Policy Management (gpmc.msc), installed on win11 with RSAT. Sign in as TRAMUNTANA\Administrator, open it, and go to Forest → Domains → tramuntana.internal. Your OUs Dev, Design and Admin are in the tree.
A rule for every PC: the sign-in banner¶
Right-click the domain → Create a GPO in this domain, and Link it here → name TA-Login-Banner → Edit:
Computer Configuration > Policies > Windows Settings > Security Settings
> Local Policies > Security Options
Interactive logon: Message title for users attempting to log on -> Tramuntana Apps
Interactive logon: Message text for users attempting to log on -> Company computer.
Run gpupdate /force and sign out: the message appears before the login box, for any user.
Why link it to the domain and not to an OU? The banner is a computer setting, so it follows the computer account. WIN11 sits in the default container Computers, and a container cannot take a GPO link. The domain is above everything, so its sheet reaches every PC.
A rule for one department¶
Right-click the OU Design → Create a GPO in this domain, and Link it here → name TA-Design-NoControlPanel → Edit:
User Configuration > Policies > Administrative Templates > Control Panel
Prohibit access to Control Panel and PC settings -> Enabled
Sign in as TRAMUNTANA\joan and try to open Settings: blocked. gpresult /r lists the GPO under USER SETTINGS → Applied Group Policy Objects. Sign in as TRAMUNTANA\marta: Settings opens and the GPO is not in her list.
Careful: you did not block joan
You blocked whoever is filed in the OU Design. Move joan out and the rule leaves him; move marta in and it reaches her. The rule is on the door, not on the person.
Who wins?¶
The domain GPO says "wallpaper: blue"; the GPO on Design says "wallpaper: yellow". What does joan see?
A client applies the sheets in a fixed order, and a later sheet overwrites an earlier one where both set the same thing. Memory hook: LSDOU.
flowchart LR
L["<b>1. Local</b><br>the note on your desk"] --> S["<b>2. Site</b><br>the street gate"]
S --> D["<b>3. Domain</b><br>the main entrance"]
D --> O["<b>4. OU</b><br>parent, then child:<br>your room's door"]
O --> W(["<b>Last one wins</b>"])
| Order | Level | In the building |
|---|---|---|
| 1 | Local policy | The note on your own desk (secpol.msc) |
| 2 | Site | The street gate — Tramuntana has one site, ignore it |
| 3 | Domain | The main entrance |
| 4 | OU, parent then child | Your room's door |
The last door wins, so joan sees yellow. Settings that do not collide add up: joan gets the banner from the domain and the blocked Settings from Design.
One exception: the password policy
The password policy of domain accounts (length, expiry, lockout) is read only at domain level; in a GPO on an OU it does nothing. On a Samba DC it is not set in a GPO at all, but with sudo samba-tool domain passwordsettings show (and set) on dc1.
A folder for a domain group¶
Who can check a domain account? Only a machine of the domain. ubu-srv is not joined, so this folder lives on one that is: dc1. The group is now TRAMUNTANA\dev.
A shortcut for the lab
Samba's documentation advises against using a DC as the company's file server. A real office joins its file server to the domain. In the lab, a share on dc1 keeps the shares of ubu-srv safe.
Two locks, as always¶
As in Share permissions and groups, a share has a share permission and a file-system permission, and the most restrictive wins. The standard way: leave the share lock wide and do the real work on the file-system lock, always with groups. Never write a person's name on a folder: write the department. When Pau finishes his internship, you take him out of one group and every door closes at once.
On dc1:
At the end of smb.conf add:
smbcontrol all reload-config makes Samba read the file again without stopping.
On win11 as TRAMUNTANA\Administrator, open \\dc1\dev → right-click inside → Properties → Security → Advanced → Disable inheritance (convert) → remove Everyone and Users → add TRAMUNTANA\dev with Modify. Keep Domain Admins with Full control. On a Samba DC the domain Administrator is mapped to root, which is why he can set these permissions from Windows.
Test with someone who must not get in¶
| marta (dev) | joan (design) | |
|---|---|---|
Open \\dc1\dev |
Opens | Access is denied |
| Create a file there | hello-marta.txt is created |
— |
A share is not finished until somebody who must not get in has tried and failed. whoami /groups as marta lists TRAMUNTANA\dev: that is the key that opened the folder.
A drive letter for the department¶
In gpmc.msc: OU Dev → new GPO TA-Dev-Drive → Edit:
User Configuration > Preferences > Windows Settings > Drive Maps > New > Mapped Drive
Action: Update Location: \\dc1\dev Reconnect: yes Drive Letter: S
Sign in as marta and run net use: she has S:. joan has none. Preferences exist only in domain GPOs, not in the local gpedit.msc.
Predict: the group and the OU in one case
Pau is an intern in dev. Aina moves his account to a new OU Interns that has no GPO, but he stays in the group dev. After his next login:
- He keeps access to
\\dc1\dev: the permission is on the group, and he is still in it. - He loses the
S:drive: the drive map was a rule on the OUDev, and he no longer walks through that door. The typed path still works.
When it does not work¶
| Symptom | Cause and fix |
|---|---|
| The banner never appears | Linked to an OU of users. It is a computer setting: link it to the domain |
| joan still opens Settings | joan is still in the container Users, not in the OU Design. Move him; sign out and in |
joan gets into \\dc1\dev |
Everyone or Users still on the Security tab by inheritance. Disable inheritance and remove them |
\\dc1\dev not found |
The client's DNS must be 192.168.122.20: ping dc1, ipconfig /all. Or Samba was not reloaded |
| I changed a GPO and nothing happened | Refresh is every 90 minutes: gpupdate /force, and sign out for user settings |
Key takeaways¶
- A GPO is a named set of settings, linked to a site, a domain or an OU, never to a group.
- Computer Configuration follows the computer account and applies at start-up; User Configuration follows the user account and applies at login.
- Order LSDOU: local, site, domain, OU (parent then child). The last one applied wins; settings that do not collide add up.
gpupdate /forceapplies now;gpresult /rshows what was applied.- Permissions on a shared folder go to groups; leave the share lock wide and set the file-system lock. Always test with someone who must be denied.
- Groups open resources; OUs receive rules.
Quick check¶
1. A GPO can be linked to which of these?
- A site, a domain or an OU
- A group of users
- A single user account
- A shared folder
Despite the name, Group Policy is linked to places in the directory: a site, the domain or an OU. Everything below that place applies it.
2. The login banner is a computer setting. When does it reach a PC?
- When the computer account is below the place where the GPO is linked
- When the user who signs in is in the right OU
- When the user is a member of Domain Admins
- When the user accepts it at the first login
Computer Configuration follows the computer account. That is why the banner was linked to the domain: WIN11 sits in the container Computers, which cannot take a link.
3. The domain GPO says blue wallpaper; the GPO on the OU Design says yellow. What does joan, in Design, see?
- Yellow, because the OU is applied last
- Blue, because the domain is more important
- Both wallpapers, one after the other
- Neither, because the two GPOs cancel out
The order is local, site, domain, OU, and the last one applied wins where two GPOs set the same thing.
4. marta is moved to another OU but stays in the group dev. What happens with the dev share on dc1?
- It still opens for her
- It disappears from the server
- It becomes read-only for her
- It is denied until she moves back
The permission on the folder is on the group dev, and she is still in it. Moving her to another OU only changes which rules reach her.
5. Which command shows the GPOs that were applied to you?
- gpresult /r
- gpupdate /force
- net use
- whoami /groups
gpresult /r lists the applied GPOs for the computer and the user. gpupdate /force applies them now, net use lists mapped drives and whoami /groups lists group memberships.
6. You add joan to the group dev, but he still cannot open the dev share. What is the most likely reason?
- Group membership is read at login, so he must sign out and in
- Groups only work after the next 90-minute GPO refresh of the DC
- joan must first be moved to the OU Dev
- The share needs to be deleted and created again
A user's groups are read when he logs in. Until joan signs out and in again, his session still carries his old list of groups.
7. Tramuntana wants every developer to get drive S: and only developers to be able to write in the dev folder. Select the two correct pieces.
- A GPO with a drive map, linked to the OU Dev
- Modify permission for the group dev on the folder
- A GPO linked to the group dev that gives write access
- Modify permission for each developer by name on the folder
The drive letter is a rule, so it goes on the OU. The write access is a permission, so it goes to the group. GPOs cannot be linked to groups, and names of people on folders break as soon as someone joins or leaves.
Today you decided who may open a folder. Next: what happens when somebody opens it who should not — Why protect systems.