When a folder is created, the creator (user) becomes the owner.

Alex Ch 70 Reputation points
2023-10-26T07:48:38.9233333+00:00

Hello! When a folder is created, the creator (user) becomes the owner.

How can I make sure that the owner is automatically changed, for example, to administrator, since, for example, the user created a folder, became the owner and can change the rights on it.

I mean that he can create it, it will be applied that he is the owner, but later change it to administrator, for example, if there is such functionality from the GPO.

There is no way to keep track of many folders.

Remove the security tab.

They will perform a recalculation on each folder with a storage depth of the load on the FS.

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,724 questions
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 34,686 Reputation points
    2023-10-27T21:52:46.7166667+00:00

    Restrict access at the share level.

    https://superuser.com/questions/1278120/prevent-user-to-change-file-permission-on-its-files

    You can use takeown.exe to reset ownership on files and folders. The one downside to this is that you might have reset every file/folder in the entire folder structure.

    Here's a Powershell script that you can use to report on ownership, and reset the owner for files/folders that do not match the specified group.

    $folder = "C:\Temp"         # the folder to analyze 
    $update = $false           # $true or $false, to update the owner. Set this to flag to run a report. 
    $admins = New-Object System.Security.Principal.Ntaccount("BUILTIN\Administrators")    # The account that you want to own the files/folders      
    Get-ChildItem $folder -Recurse | foreach {       # add the -Directory switch to GCI to only look at directories 
        $acl = Get-Acl $_.FullName
        if ($acl.Owner -ne $admins.Value) {                       
            $owner = $acl.owner                   # save the original owner 
            if ($update) {                        # if $update -eq $true, then update the owner 
                $acl.setowner($admins)
                Set-Acl $_.FullName -AclObject $acl      # -whatif   
                "*Updated* - {0} - {1}" -f $owner, $_.FullName
            } else {
                "{0} - {1}" -f $owner, $_.FullName   
            } 
        }
    }
    

1 additional answer

Sort by: Most helpful
  1. Alex Ch 70 Reputation points
    2023-10-29T12:36:33.8233333+00:00

    I took the advice from the article you included in your answer. Thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.