Windows Server 2008 R2 – Make owner of created files BUILTIN\Administrators

file-permissionswindows-server-2008-r2

I am encountering some difficulty with makeing the owner of files created in a particular directory to be the Built In Administrators group, rather than the actual user that created it. This seems to be the standard behavior on Windows Server 2003, but I can't figure out how to make it work on Server 2008 R2

The reason I want to do this is because the user that creates the files is a local user, and hence when I try to access information about the files created programatically, I can't translate the SID into a user account. Ideally if the files had their creator / owner as the built in Administrators group, it would have a well know SID that could be translated to a user account.

Any assistance would be greatly appreciated.

Best Answer

For Old Files:

You can use a tool to do the job for you called "SubInACL.exe" that is part of the Windows Resource Kit Tools: http://www.microsoft.com/en-us/download/details.aspx?id=23510

The tool is easy to use, here's an example for changing an ownership of a text file:

Subinacl /File TestFile.txt /Setowner=Domain\User

Edit 1: For Newly Created Files:

You're in luck, the option is not included in Windows 2008, but you can add it later on and make it work just like Windows 2003, the steps are too long to fit in here though, so I'll just paste a link for them: http://kamalblogs.wordpress.com/2010/08/03/setting-default-object-owner-as-object-creator-in-window-server-2008-for-aif-in-dynamics-ax/

Edit 2: It appears there's a tool to do this already in here: http://floditt.blogspot.com/2011/01/aif-message-header-editor-reloaded.html

Hope this helps.