Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I know that I can copy existing ACLs using get-acl and then modify them using set-acl, but is there a way I can create a new, blank acl and then add in what I need? For example:

$foo = new-acl
#push some access rules into $foo
set-acl C:\myFolder $foo
share|improve this question

1 Answer 1

You need to use the .NET object:

$emptyACL = New-Object System.Security.AccessControl.DirectorySecurity

Note, I found this by using the Get-Member function to find the TypeName:

$ACL = Get-ACL C:\some_directory
$ACL | Get-Member
   TypeName: System.Security.AccessControl.DirectorySecurity
  Name                            MemberType     Definition
  ----                            ----------     ----------
  .........................................................
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.