Skip to content
Visual explainer 3h to learn 4 steps

Windows accounts, UAC & Group Policy

Explain local vs domain accounts, UAC and how Group Policy enforces settings.

By Invicly Tech, , in Cyber Security Fundamentals. About 10 minutes to read.

Topic 13 of 49

In short

Windows has local accounts on one machine and domain accounts managed centrally by Active Directory. User Account Control limits admin power until explicitly needed, and Group Policy pushes settings to many machines at once.

Explained simply

Windows has two main kinds of user accounts. A local account exists on one computer only, stored in that computer's own database. A domain account lives in Active Directory (AD), a central directory run on servers called domain controllers, and works on every computer joined to that domain.

Being an administrator on Windows is powerful, so Windows does not use that power all the time. User Account Control (UAC) runs your programs as a normal user, even if you are an admin. When a program needs more, a prompt asks you to approve.

Group Policy is how companies set rules for thousands of computers at once. An admin writes a policy once, for example "lock the screen after 10 minutes" or "turn on the firewall", and every computer in the right group applies it automatically.

For defenders, the most important question is: who is an administrator, and where? Every extra admin account is one more account an attacker can steal. Regularly checking the local Administrators group on each machine is simple and catches many problems.

Press Play on a diagram to walk through it one step at a time.

CompareLocal vs domain accounts
Local account
  • Exists on one machine
  • Managed on that host
  • No central policy
  • Fine for standalone PCs
Domain account
  • Managed in Active Directory
  • Signs in anywhere in domain
  • Group Policy applies
  • Central control and audit
MapWhere Windows accounts and admin rights come from
Windows identity
  • Local accounts
    • Stored in SAM
    • Administrator is RID 500
    • Valid on one PC
  • Domain accounts
    • Stored in AD on DCs
    • Kerberos sign-in
    • Work on any joined PC
  • Local Administrators group
    • SID S-1-5-32-544
    • Can include domain groups
  • Domain admin groups
    • Domain Admins
    • Enterprise Admins

In depth

Where accounts live and how Windows names them

Local accounts are stored in the SAM (Security Account Manager) database on each machine. Domain accounts are stored in the AD database on domain controllers, and the domain controller checks the password when you sign in, usually with the Kerberos protocol.

Windows does not really identify accounts by name. Every account and group has a SID (security identifier), a long string like S-1-5-21-...-1001. The last number is the RID (relative ID). The built-in Administrator account always has RID 500, and the local Administrators group has the well-known SID S-1-5-32-544. Renaming the Administrator account does not hide it, because tools can still find RID 500.

This also explains a common surprise: if you delete and recreate a user with the same name, it gets a new SID and loses all old permissions.

  • whoami /user shows your SID
  • whoami /groups shows your groups and integrity level
  • Domain Admins can control every machine in the domain

UAC and split tokens

When an admin signs in, Windows creates two access tokens (the bundle of identity and rights a process carries). One is a filtered, standard-user token, with admin rights removed. The other is the full admin token. Normal programs, including Explorer, start with the filtered token at medium integrity level.

When a program needs admin rights, UAC shows a prompt. For an admin, it is a consent prompt (Yes or No). For a standard user, it is a credential prompt asking for an admin's password. Once approved, that one program runs with the full token at high integrity level. The prompt appears on the secure desktop, which other programs cannot click on.

Microsoft states that UAC is not a security boundary: it reduces accidents and makes malware ask, but attackers have many known ways to bypass it. The real protection is giving people standard accounts.

SequenceElevating a program with UAC
User
Program
Windows (UAC)
  1. 1Start program (filtered token)
    User to Program: Start program (filtered token)
  2. 2Request admin rights
    Program to Windows (UAC): Request admin rights
  3. 3Secure desktop prompt
    Windows (UAC) to User: Secure desktop prompt
  4. 4Approve (or enter admin password)
    User to Windows (UAC): Approve (or enter admin password)
  5. 5Restart with full admin token
    Windows (UAC) to Program: Restart with full admin token

How Group Policy applies

A Group Policy Object (GPO) is a bundle of settings. It has two halves: Computer Configuration, applied at startup to the machine, and User Configuration, applied at sign-in to the user. GPOs are linked to sites, domains or OUs (organizational units, folders in AD that hold users and computers).

Policies apply in the order Local, Site, Domain, OU, often written LSDOU. When two GPOs set the same thing, the one applied later wins, so a setting on a child OU beats one on the domain. Two switches change this: Block Inheritance on an OU ignores parent GPOs, and Enforced on a GPO link makes it win anyway.

Computers refresh policy in the background every 90 minutes plus a random offset of up to 30 minutes; domain controllers every 5 minutes. gpupdate /force refreshes now, and gpresult /r shows which GPOs actually applied.

FlowGPO processing order (later wins)
  1. 1
    Local policy

    Set on the machine itself

  2. 2
    Site

    GPOs linked to the AD site

  3. 3
    Domain

    GPOs linked to the domain

  4. 4
    Parent OU

    Outer OU first

  5. 5
    Child OU

    Closest OU applies last

Controlling local administrators

Attackers love local admin rights. With them they can turn off defences, install tools and dump stored credentials from memory. A shared local Administrator password across all machines is especially dangerous: steal it once, and you can sign in to every PC. This is how many ransomware attacks spread.

Three defences work together. First, Windows LAPS (Local Administrator Password Solution), built into current Windows versions, gives every machine a unique, random local admin password that rotates automatically and is stored in AD or Microsoft Entra ID. Second, control membership of the local Administrators group centrally with Group Policy, so extra members get removed. Third, alert when someone is added: event 4732 records a member added to a security-enabled local group.

Keep daily-use accounts as standard users, and give admins a separate account for admin work only.

  • net localgroup administrators lists members
  • Get-LocalGroupMember -Group Administrators does the same in PowerShell
  • Event 4732: member added to a local group

Learn it in 4 short steps

About 45m each. Track them with a timer in your plan.

  1. 1
    Compare local and domain accounts~45m
  2. 2
    Explain UAC and admin tokens~45m
  3. 3
    Apply a Group Policy setting~45m
  4. 4
    Review local administrators group~45m

Key points

  • Local accounts live on a single machine only.
  • Domain accounts are centrally managed in Active Directory.
  • UAC withholds admin rights until a user approves.
  • Group Policy enforces settings across the domain.

Key terms

Tap a card to flip it. 0/4 known

Examples

Auditing local administrators on a PC

Step 1: open PowerShell as an admin and list members of the local Administrators group. Step 2: expect a small, known set: the built-in Administrator (often disabled) and perhaps a helpdesk group from the domain. Step 3: anything else, such as a normal user account or an unknown local account, needs a reason. Step 4: remove it, and check the Security log for event 4732 to see who added it and when.

powershell
Get-LocalGroupMember -Group "Administrators" |
  Select-Object Name, ObjectClass, PrincipalSource
# Remove an unexpected member
Remove-LocalGroupMember -Group "Administrators" -Member "PC01\tempuser"
# Who added members recently?
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4732} -MaxEvents 10 |
  Format-List TimeCreated, Message

Applying a screen lock policy with a GPO

Step 1: in Group Policy Management, create a GPO named "Workstation screen lock" and link it to the Workstations OU. Step 2: edit it: Computer Configuration, Policies, Windows Settings, Security Settings, Local Policies, Security Options, "Interactive logon: Machine inactivity limit" set to 600 seconds. Step 3: on a test PC run gpupdate /force. Step 4: run gpresult /r /scope computer and confirm the GPO is listed under applied policies. Step 5: if it is missing, check that the PC is in that OU and that security filtering includes it.

powershell
gpupdate /force
gpresult /r /scope computer
# Full HTML report of applied settings:
gpresult /h C:\Temp\gp-report.html

Quick reference

  • Local accounts live in SAM; domain accounts live in Active Directory on DCs
  • Built-in Administrator is always RID 500; Administrators group is S-1-5-32-544
  • UAC gives admins a filtered token until they approve elevation
  • GPO order is Local, Site, Domain, OU; the later one wins unless Enforced
  • gpupdate /force refreshes policy; gpresult /r shows what applied
  • Windows LAPS gives each PC a unique, rotating local admin password
  • Event 4732: a member was added to a security-enabled local group
  • Use separate accounts for admin work and for email and browsing

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1An admin user opens Notepad normally. Which token does it run with?

Question 2

2A domain GPO sets the screen lock to 15 minutes and an OU GPO sets 10 minutes. Neither is Enforced. Which applies to a PC in that OU?

Question 3

3Why is the same local admin password on every PC dangerous?

Question 4

4Renaming the built-in Administrator account to "bob" mainly does what?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    On your own Windows PC, show your SID, your groups and your current integrity level. Then open PowerShell as administrator and compare.

  2. Exercise 2medium

    Write a PowerShell snippet that lists local Administrators members and flags any that are not on an approved list.

  3. Exercise 3hard

    In a lab domain, design how you would make sure only the Helpdesk-Admins group is in every workstation's local Administrators group, and how you would detect changes.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Should I turn off UAC?
No. Turning it off makes every admin program run with full rights silently. Keep it on and, better still, use a standard account for daily work.
What is the difference between Active Directory and Microsoft Entra ID?
Active Directory is the on-premises directory that uses Kerberos and Group Policy. Microsoft Entra ID (formerly Azure AD) is Microsoft's cloud identity service for Microsoft 365 and web apps. Many companies use both, synced together.
How often does Group Policy refresh?
Every 90 minutes plus a random offset of up to 30 minutes on member computers, and every 5 minutes on domain controllers. Some settings only apply at restart or next sign-in.
ShareXLinkedInWhatsApp