Closed Xento closed 6 years ago
You, can achieve this by using the following sequence:
$sd = Get-NTFSSecurityDescriptor -Path D:\AL1.json
$sd | Disable-NTFSAccessInheritance -RemoveInheritedAccessRules
$sd | Add-NTFSAccess -Account Everyone -AccessRights Read -AppliesTo ThisFolderSubfoldersAndFiles
$sd | Add-NTFSAccess -Account Administrators -AccessRights FullControl -AppliesTo ThisFolderSubfoldersAndFiles
$sd | Set-NTFSSecurityDescriptor
Is it possible to apply multiple permissionchanges at once? For example remove one group and add an other in one run? Actually it first performs the remove and then it adds the group because this are two independent cmdlet calls.