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?
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?
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.