Hello everyone,
I need to delete all user and group permissions from a folder. Unfortunately Powershell doesn't want to accept my wildcard * to delete everyone. Is there a way to delete everyone's permission from that folder?
What I have now:
$homedir="ipsum\ipsum2\martijn" #Delete Inheritance (WORKS) $acl = get-acl $homedir $isProtected = $true $preserveInheritance = $true $acl.SetAccessRuleProtection($isProtected, $preserveInheritance) Set-Acl -Path $homedir -AclObject $acl #Delete the permissions (DOESN'T WORK) $acl = get-acl $homedir $account = new-object system.security.principal.ntaccount("*") $acl.purgeaccessrules($account) set-acl -aclobject $acl -path $homedir
As you can see I already deleted the Inheritance but still need to delete ALL of the permissions on the folder. This line gives an error:
$account = new-object system.security.principal.ntaccount("*")
Because it doesn't know what I mean with the wildcard *. So does anyone know how I can do this with only Powershell 2.0 and nothing else?


