Server Sign-Ins Refused After a GPO Adds a Group to a Deny Log On User Right
Overview
When server sign-ins fail with event 4625 status 0xC000015B after a Group Policy change, check whether a GPO added a group to a Deny log on right, which supersedes the Allow right. Find the GPO with gpresult, back it up with Backup-GPO, restore the known-good version, refresh policy and confirm sign-in.
Diagnose
Symptom
What responders observe.
Start here when sign-ins to domain-joined servers start failing soon after a hardening change to Group Policy, and the failures share a sign-in method rather than a user: administrators can no longer connect over Remote Desktop to servers in one OU, while the console still works; a service account or application gets access denied when it connects to a file share or other network service on those servers.
Three rights cause most of these.
Their Group Policy path is Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment: RightConstantSign-in it blocksLogon Type in event 4625 Deny log on through Remote Desktop ServicesSeDenyRemoteInteractiveLogonRightRemote Desktop and Remote Assistance10 (RemoteInteractive) Deny access to this computer from the networkSeDenyNetworkLogonRightShares and other network access3 (Network) Deny log on locallySeDenyInteractiveLogonRightSign-in at the console2 (Interactive)
Detection
Metrics, logs and confirmation commands.
Root cause
Why the incident occurred.
Contain and prevent
Blast radius
What else this can affect.
Prevention
Controls and guardrails that stop it recurring.
-
Deny rights are a sound control.
-
The failure was the rollout.
-
Back up every GPO on a schedule with Backup-GPO -All -Path to a share, so a known-good version always exists.
-
Microsoft's advice for Deny log on locally is to test it together with Allow log on locally, and its pages for each Deny right warn that assigning it to other groups can limit administrative roles, so confirm delegated tasks still work before the GPO is linked to production OUs.
-
Link hardening GPOs to a pilot OU first and check gpresult and event 4625 there before widening the link.
-
Scope changes break sign-in as easily as setting changes.
-
The same pattern appears when someone removes Authenticated Users from a GPO's security filter.
-
Record the incident GPO, both backup IDs and the restored version in the change ticket.
Fix
Pre-flight checks
Check these before you change anything.
-
The Group Policy PowerShell module on an admin workstation.
-
Edit rights on the affected GPO, or the GPO owner on hand.
-
Access to the affected servers by console or a network path that is not denied.
-
A GPO backup share, if one exists.
Commands
whoami /groups
Get-WinEvent -ComputerName SRV01 -FilterHashtable @{ LogName='Security'; Id=4625; StartTime=(Get-Date).AddHours(-4) }
gpresult /s SRV01 /scope computer /z > C:\IR\SRV01-rsop.txt
Get-GPO -All | Sort-Object ModificationTime -Descending | Select-Object -First 10 DisplayName, Id, ModificationTime
Get-GPOReport -Name "Server Hardening" -ReportType HTML -Path C:\IR\server-hardening-now.html
Get-GPPermission -Name "Server Hardening" -TargetName "CONTOSO\gpo-admins" -TargetType Group
Backup-GPO -Name "Server Hardening" -Path C:\IR\GpoBackups -Comment "Before deny-right incident fix"
Restore-GPO -BackupId <known-good-backup-id> -Path \\FS01\GpoBackups -WhatIf
Restore-GPO -BackupId <known-good-backup-id> -Path \\FS01\GpoBackups
Invoke-GPUpdate -Computer SRV01 -RandomDelayInMinutes 0 -Force
gpupdate /target:computer /force
secedit /export /mergedpolicy /cfg C:\IR\SRV01-rights.inf /areas user_rights
Verify and recover
Verification
Evidence required before you close the incident.
-
Run gpresult /s SRV01 /scope computer /z after the refresh. — User Rights Assignment output for the computer. — The Deny right no longer lists the group, or no longer comes from this GPO.
-
Run secedit /export /mergedpolicy /cfg C:\IR\SRV01-rights.inf /areas user_rights at the console. — An .inf export of the server's user rights. — The group is not listed against the Deny right. Have an affected user and service account sign in the way they were refused. — Successful sign-in and no new event 4625 for them. — No new 4625 events with 0xC000015B for those accounts.
Rollback
The safe way back.
-
Run Restore-GPO -BackupId <incident-backup-id> -Path C:\IR\GpoBackups to return the GPO to the state captured before the fix.
-
Refresh policy on the affected servers with Invoke-GPUpdate or gpupdate /target:computer /force and repeat the gpresult check.
-
If you removed the group by hand instead of restoring, roll back by restoring the same incident backup.
Escalate when
Conditions that need another owner.
-
Immediately, to the directory service owner, if the GPO reaches domain controllers and the network right is involved.
-
To the GPO owner when you lack edit permission, when there is no known-good backup and the change is unclear, or when a link or filter change brought the right into scope.
-
To Microsoft support or your platform team if gpresult shows the GPO no longer sets the right but the secedit export still lists the group after a refresh.
-
If one round of refresh and verification has not restored sign-in, stop editing and escalate.
-
GPO owner Platform team or Microsoft support.
Fixed? Get the next one before it hits you: The KBY Brief
Practical fixes for the systems you run, by email about twice a week. Unsubscribe at any time.
About this page
Credited to
Dates
Published
Corrections
No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
Sources
Based on the vendor sources listed below. Check each step against your environment before acting.
First published 20 November 2026
Deny log on through Remote Desktop Services
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Deny access to this computer from the network
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Deny log on locally
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
4625(F) An account failed to log on
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
gpresult
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
gpupdate
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
secedit /export
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
whoami
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Get-GPO
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Get-GPOReport
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Get-GPPermission
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Backup-GPO
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Restore-GPO
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Invoke-GPUpdate
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Get-WinEvent
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.