Gongalong Posted October 12, 2018 Posted October 12, 2018 Hi folks, Can anyone recommend any apps that can make light work of file/folder permissions? e.g. take ownership, apply inherited permissions etc. Looking for recommendations from people that have used them. Thanks
Arthur Posted October 12, 2018 Posted October 12, 2018 (edited) I have used the following apps to change permissions... GUI: SetACL Studio, WiseSoft NTFSFix CLI: SetACL, NTFS Security (PowerShell Module) As to which is best, that will depend on what you are trying to do. For example, are you looking for something to reset home folder permissions? Here's a script that uses the NTFS Security PowerShell module to reset permissions on student user areas. You could adapt it to your needs. #Requires -RunAsAdministrator Import-Module NTFSSecurity Get-ChildItem2 -Path "X:\Users\Students" -Directory | ForEach { Get-ChildItem2 -Path $_.FullName -Directory | ForEach { $UserName = $_.Name $UserNameFQ = [io.path]::Combine($env:USERDOMAIN, $UserName) $_ | ForEach { try { Write-Output "$UserName - Setting permissions on $($_)" Add-NTFSAccess -Path $_.FullName -Account $UserNameFQ -AccessRights Modify -AccessType Allow -AppliesTo ThisFolderSubfoldersAndFiles -ErrorAction Stop } catch { Write-Warning "$($_.Exception.Message)`n" } try { Write-Output "$UserName - Setting owner`n" Get-ChildItem2 -Path $_.FullName -Recurse -Hidden -System -Force | Set-NTFSOwner -Account $UserNameFQ -ErrorAction Stop } catch { Write-Warning "$($_.Exception.Message)`n" } } } } ^ The reason I am using Get-ChildItem2 instead of Get-ChildItem is because the former handles long file/folder names. Run the following command to display the syntax of the various NTFS Security cmdlets. Get-Command -Module NTFSSecurity -CommandType Cmdlet -Syntax | Out-GridView Edited October 12, 2018 by Arthur 2
Gongalong Posted October 12, 2018 Author Posted October 12, 2018 Thanks! I have an issue where permissions on student folders keep resetting, so while I look deeper into the issue it will be useful to have something that just gives me the quickest way to take ownership of a folder and also switch it back to inheritable permissions. I doubt this can be done on mass because this of course a subfolder of the student's home folder. I have a way to do it programatically as well, via TAKEOWN and ICACLS and a list of students. Next project will be to use PowerShell and read in the folders and do it, but need to find the underlying issue first ideally!
Arthur Posted October 12, 2018 Posted October 12, 2018 I doubt this can be done on mass because this of course a subfolder of the student's home folder. Does the subfolder have the same folder name for each student?
Gongalong Posted October 12, 2018 Author Posted October 12, 2018 (edited) Yes, it's always the Documents system folder. This is my underlying issue: http://www.edugeek.net/forums/windows-server-2012/200385-documents-folder-permissions-weirdness.html Edited October 12, 2018 by Gongalong
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now