Domanda

I have a share with a file structue like so

Public ( no restrictions ) Sales ( only sales people have access ) Production ( Production only has access to this )

I created the permissions, but if someone creates a new folder in there, the permissions on that new folder is not the same as the parrent, Is there a way to force permissions ( or even a script I could run to re-set the permissions nightly )

È stato utile?

Soluzione

This can be done through the GUI as a once off - click the Advanced button on the Security tab in the folder properties, and make you've disabled inheritance on your main sub folders, and then check to ensure any custom security settings apply to "this folder, sub folders and files". You may also need to check "replace all child object permissions ..." as well.

From the command prompt, you can use the command "icacls" which is really powerful and is what I tend to use when configuring permissions like this.

Altri suggerimenti

as u suggested, I wrote below script. Hope it could help

    $folders = Get-ChildItem -Path $share -Directory
    foreach ($folder in $folders)
    {
        $acl = Get-Acl $folder
        Get-ChildItem $folder -Recurse | %{Set-Acl -Path $_.FullName -AclObject $acl}
    }
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top