IT_Man_Dan Posted August 27, 2021 Posted August 27, 2021 Morning all, I have messed up folder permissions on one of my year groups home areas and need to reassign the user permissions to their folder. I've tried setting the home area in bulk in AD but it just says the home area already exists and hasn't been created and doesn't assign rights. When doing it per user it asks you if you want to grant permission to the existing folder. Previously years ago I used NTFSFix to resolve this issue. Does anyone know whether: A: NTFSFix still works on Server 2019? B: If not, is there an equivalent tool? Many thanks
ShellfishClive Posted August 27, 2021 Posted August 27, 2021 (edited) I don't know of any tool that would do this but I've never tried, if nobody gets back to you shortly with an update I can write a PS script that will sort this for you. Edit: [color=#9CDCFE][font="]$user[/font][/color][color=#D4D4D4][font="] = [/font][/color][color=#DCDCAA][font="]Get-ADUser[/font][/color][color=#D4D4D4][font="] -SearchBase [/font][/color][color=#CE9178][font="]"insert OU Path here"[/font][/color][color=#D4D4D4][font="] - Filter *[/font][/color][color=#D4D4D4][font="][color=#C586C0]foreach[/color]([color=#9CDCFE]$user[/color] [color=#C586C0]in[/color] [color=#9CDCFE]$users[/color]){ [color=#9CDCFE]$homeFolderPath[/color] = [color=#9CDCFE]$user[/color][color=#DCDCAA].HomeDirectory[/color] [color=#9CDCFE]$username[/color] = [color=#9CDCFE]$user[/color][color=#DCDCAA].SamAccountName[/color] [color=#9CDCFE]$acl[/color] = [color=#DCDCAA]Get-ACL[/color] [color=#9CDCFE]$homeFolderPath[/color] [color=#9CDCFE]$AccessRule[/color] = [color=#DCDCAA]New-Object[/color] System.Security.AccessControl.FileSystemAccessRule([color=#CE9178]"domain\[/color][color=#9CDCFE]$username[/color][color=#CE9178]"[/color],[color=#CE9178]"Modify"[/color],[color=#CE9178]"ContainerInherit,ObjectInherit"[/color],[color=#CE9178]"None"[/color],[color=#CE9178]"Allow"[/color]) [color=#9CDCFE]$acl[/color][color=#DCDCAA].SetAccessRule[/color]([color=#9CDCFE]$AccessRule[/color]) [color=#9CDCFE]$acl[/color] | [color=#DCDCAA]Set-Acl[/color] [color=#9CDCFE]$homeFolderPath[/color] } [/font][/color] At the moment I don't have time to test this, you will just need to enter an OU path that you would like this to run against and change the domain to your domain in the $AccessRule variable. Edited August 27, 2021 by ShellfishClive 1
3s-gtech Posted August 27, 2021 Posted August 27, 2021 Yes, NTFSFix still works. I use it every year to modify the default permissions given to newly created home areas (removing Full Control etc). Can’t remember if the installer runs in .NET 1.1, if so you’ll need to extract the exe another way (which uses .NET 2.0 which runs if you have the 3.5 feature installed). 1
IT_Man_Dan Posted August 27, 2021 Author Posted August 27, 2021 Yes, NTFSFix still works. I use it every year to modify the default permissions given to newly created home areas (removing Full Control etc). Can’t remember if the installer runs in .NET 1.1, if so you’ll need to extract the exe another way (which uses .NET 2.0 which runs if you have the 3.5 feature installed). Many thanks. This is good to know, Yes it does require .NET 1.1 Please can you elaborate on extracting the exe to run without .NET 1.1 ? Thanks
3s-gtech Posted August 27, 2021 Posted August 27, 2021 Many thanks. This is good to know, Yes it does require .NET 1.1 Please can you elaborate on extracting the exe to run without .NET 1.1 ? Thanks Haven’t done it for ages. You could install it on an ancient XP box to extract the exe and dlls (everyone has an old laptop hanging around with XP on don’t they?!) See if it’ll extract with 7-Zip (a better option) See if someone can send you the extracted files as a zip (I’m not at work currently so don’t have it to hand).
HPlum78 Posted August 27, 2021 Posted August 27, 2021 (edited) https://devblogs.microsoft.com/scripting/restore-ntfs-security-permissions-by-using-powershell/ In Ed Wilson we trust That is on the back of the money used by anyone who has done any scripting in the last 20 years. Edited August 27, 2021 by HPlum78 1
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