Entfernen eines Rechteeintrags aus einer Zugriffsrechteliste
Autor: Dr. Holger Schwichtenberg
ACL schreiben: Alle ACEs eines Benutzer loeschenEingabedaten$DIR = "g:\daten\kunden" $BENUTZER = "itv\HS" $Count = 0 Kontrollausgabe$acl = Get-Acl $DIR "ACL vorher:" $acl | format-list ACL holen$acl = Get-Acl g:\daten\kunden $Account = new-object system.security.principal.ntaccount("itv\hs") $acl.PurgeAccessRules($Account) set-acl -AclObject $ACL -Path $DIR ACL speichernset-acl -AclObject $ACL -Path $DIR Kontrollausgabe$acl = Get-Acl $DIR "ACL nachher:" $acl | format-list
$DIR = "g:\daten\kunden" $BENUTZER = "itv\HS" $Count = 0
$acl = Get-Acl $DIR "ACL vorher:" $acl | format-list
$acl = Get-Acl g:\daten\kunden $Account = new-object system.security.principal.ntaccount("itv\hs") $acl.PurgeAccessRules($Account) set-acl -AclObject $ACL -Path $DIR
set-acl -AclObject $ACL -Path $DIR
$acl = Get-Acl $DIR "ACL nachher:" $acl | format-list
Liste aller Codebeispiele Definition '.NET Framework Class Library' PowerShell Community Portal