- for /f %%a in (servers.txt) do (
- icacls \\%%a\folder /remove:g Everyone
- icacls \\%%a\folder\logs /remove:g Everyone
- icacls \\%%a\folder\logs /remove:g user
- icacls \\%%a\folder\ /grant "Security Group":R
- )
Adding and Removing permissions from shared folder
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Adding and Removing permissions from shared folder
I am trying to find the equivalent to the below in powershell. I see that there is a cmdlet called Get-ACL but I dont see a modifying cmdlet.
Re: Adding and Removing permissions from shared folder
When you need companion CmdLets use help to find them.
help get-acl -online
The help will list the paired commands and will give you examples.
help get-acl -online
The help will list the paired commands and will give you examples.
Re: Adding and Removing permissions from shared folder
Ok what I am truly asking is this the right route for changing permissions on a shared folder?
Re: Adding and Removing permissions from shared folder
On a folder or on a share? You cannot use either to alter a share. Both only change the underlying folder.
ICACLS works correctly in PowerShell. No need to change it.
ICACLS works correctly in PowerShell. No need to change it.