guidox / Security

Reset the Permissions on a User Profile Folder

TL;DR

Take ownership of the profile folder, then run **icacls <path> /reset /T /C** to reapply inherited permissions. Never reset the whole Users tree, only the one profile.

Before you start

Requirements

  • Admin rights
  • Another account for the repair
  • 20 minutes
Step by step

Instructions

01

Confirm the permission problem

An access denied on your own Documents folder is the symptom. Reading the ACL shows whether the owner entry is missing or explicitly denied.

icacls "C:\Users\bob"
(Get-Acl 'C:\Users\bob').Access | Select-Object IdentityReference,FileSystemRights,AccessControlType,IsInherited
Get-Acl 'C:\Users\bob' | Select-Object Owner
02

Work from another admin account

The affected profile cannot repair itself while it is loaded. Sign in as a second admin so the files are not locked by the current session.

whoami
Get-LocalGroupMember -Group Administrators | Select-Object Name
Get-Process explorer | Select-Object Id,SessionId
03

Take ownership

**takeown** grants the administrator the right to change permissions. Without it, icacls fails on files owned by a deleted SID.

takeown /F "C:\Users\bob" /R /A /D Y
takeown /F "C:\Users\bob\Documents" /R /A /D Y
icacls "C:\Users\bob" | Select-Object -First 10
04

Reset the inherited permissions

**/reset** replaces explicit entries with inherited ones from the parent folder. **/T** applies it to the tree, **/C** continues past errors such as files in use.

icacls "C:\Users\bob" /reset /T /C /Q
icacls "C:\Users\bob\Documents" /reset /T /C /Q
icacls "C:\Users\bob"
05

Restore the owner and the profile entry

The profile folder belongs to the user, not to Administrators. Setting the owner back is the last step, and it decides whether the profile loads normally.

icacls "C:\Users\bob" /setowner "PC01\bob" /T /C /Q
icacls "C:\Users\bob" /grant "PC01\bob:(OI)(CI)F" /T /C /Q
Get-Acl 'C:\Users\bob' | Select-Object Owner
Get-CimInstance Win32_UserProfile | Select-Object LocalPath,SID,Loaded
06

Test the profile

Sign in as the affected user and open the usual folders. A prompt to create a temporary profile means the profile entry itself is broken, which is a different repair.

Get-WinEvent -LogName Application -MaxEvents 50 | Where-Object ProviderName -match 'User Profile Service' | Select-Object TimeCreated,Id,Message -First 3
Get-ChildItem "C:\Users\bob\Documents" -ErrorAction SilentlyContinue | Select-Object -First 5 Name
Troubleshooting

Common issues

icacls reports access denied on many files

Ownership was not taken first, or the files are locked. Repeat takeown with /R and run icacls with /C to skip locked files.

The user gets a temporary profile at sign-in

The profile is registered under a wrong SID or marked as a temporary copy. Fix the ProfileList entry, not the folder permissions.

Settings and Start menu are empty after the reset

The reset removed explicit grants for the app data folders. Reapply the inheritance from Users and restart Explorer.

takeown fails on a system folder inside the profile

Some folders are junctions to system locations. Skip them; /C continues and the profile still works.

FAQ

Frequently asked

Does this delete files?

No. It changes permissions and ownership only; the content stays.

Can I run it on C:\Users?

Do not. Resetting that tree changes every profile and can break sign-in for all accounts.

Is the ACL logged anywhere?

Only if you enabled object access auditing before the change. Afterwards there is no record of the previous state.

How to undo this

There is no automatic undo for a permission reset. Set the folder back to its previous owner with icacls /setowner and re-add any explicit grants you recorded before the change.

Changelog · 1 entry
  1. 2026-11-01
    First version
Interactive version: checklist, feedback, related guides →

Free · no account needed · tracks your progress