daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $path = 'C:\test'
  2. $acl = Get-ACL -Path $path
  3. $acl.SetAccessRuleProtection($True, $True)
  4. $acl | Select -ExpandProperty Access |
  5.     Where{ $_.IdentityReference -eq “LTCAHJ\Guest” } |
  6.         ForEach{ $acl.RemoveAccessRule($_) }
  7.  
  8. Set-Acl -Path $path -AclObject $acl
RAW Paste Data
Top