Working with Windows File and Folder NTFS Permissions (Copy and Reset)

, ,

There have been a few times recently where I’ve had end users do some weird things to either their desktops or development servers they have been working on. If they’re on Dev servers we usually just restore the servers from backup but sometimes we just need to do a quick fix.  The most common issues I find are around permissions (web develpoers tend to muck around with c:\inetpub\wwwroot a lot).  I’ve got a few tricks up my sleeve to deal with it.

Copying permissions from on folder to another is straight-forward with PowerShell

Get-Acl -Path 'C:\DemoFolder' | Set-Acl -Path 'C:\NewDemoFolder'

Other times I find we just need to reset the folder permissions back to what Windows believes the default is

icacls * /T /Q /C /RESET

Another thing is sometimes ownership info needs to be reset too, you can do that with the following command.

takeown /R /F *

Hopefully that helps out.


Leave a Reply

More Posts

Moving the SQL Server tempdb file location after SQL Server is installed

Working with one of my education customers I recently had to perform some maintenance on their SQL Database server as they were running low on disk space AND had a free unused virtual disk where we could throw their tempdb onto (it was meant to go here but they didn’t place it there during installation). […]

How to Configure the Management IP of a Palo Alto Firewall through a console connection

So I’ve recently started experimenting with a Palo Alto VM Firewall that we are about to trial.  Unfortunately they don’t offer a Hyper-V virtual machine so I’ve had to stick this into dev our ESXi host. After importing the .ovf, I edited the network adapters onto the right VLANs for me to get it going […]