0

I'm looking for a simple Powershell way to set NTFS permissions on a specific folder.

Get-Acl "\\fileserver\c$\Program Files\Target" is not even working for me. Any ideas?

MDMarra
  • 100,734
  • 32
  • 197
  • 329
Stef
  • 157
  • 1
  • 6
  • Either way, you have not posted enough information with this question for us to help you. – Brent Pabst Nov 13 '12 at 14:59
  • You should tell us *why* isn't not working. What error do you get, etc? Take a peek at [ask], it will help you ask a useful question that can be valuable to others. – MDMarra Nov 13 '12 at 15:06
  • In addition to How to Ask, please take a look at [this meta question](http://meta.serverfault.com/questions/3608/how-can-i-ask-better-questions-on-server-fault) which may help you improve this question. If you can edit this question to include enough information for us to help you leave a comment for me and I'll reopen it. – voretaq7 Nov 13 '12 at 18:58

1 Answers1

3

What you want to do is use get-acl and save it to a variable. Then, you can modify that variable and push it to the file/folder in question using set-acl

There are some good examples here and even more examples here.

If that's too complicated (it can get a bit messy at times), you can always just call icacls.exe from your PowerShell script and do it the old-fashioned way.

MDMarra
  • 100,734
  • 32
  • 197
  • 329