Domain Administrator does not have permission to remove a folder

active-directorypermissionswindows 7

I am a Windows domain administrator, and on my Windows 7 machine I have a folder that is owned by another domain user. When I right click and attempt to delete, it tells me that I don't have permission.

I logged out as myself and logged in as the domain administrator's account, attempted to delete, and again I am told that I don't have permission.

I logged out and logged back in as myself, and installed the latest version of Cygwin. Then I went to the folder above the offending folder, and performed rm -r offendingfolder. It worked. The folder is gone.

I presume there's no magic behind Cygwin and it uses the Windows authentication mechanism, so I need to know: Why couldn't I do this under Windows itself?

Thanks.

Best Answer

Why is this question downvoted? He asks why it works with Cygwin.

I don't know exactly. My guess is, Cygwin has a clever trick to grant a group full control/modify by taking ownership to a specific file/folder prior to removing it. But, again, that's speculation from my point of view, studying source code is not one of my daily routines.

It can be done through native Windows tools. For example, see KB268019 on taking ownership. It explicitly states:

Taking ownership does not automatically grant you permission to access it. You have to explicitly give the administrator permission to the folders and files.

When you are owner, you can change permission entries. Which, in this case, boils down to assigning your account at least 'Modify'-permissions to remove the offending folder.