The ACL specifies the permissions that users and user groups have to access the resource.
Set-Acl – The Set-Acl cmdlet changes the security descriptor of a specified item, such as a file or a registry key, to match the values in a security descriptor that you supply.
To use Set-Acl, use the Path or InputObject parameter to identify the item whose security descriptor you want to change.
Then, use the AclObject or SecurityDescriptor parameters to supply a security descriptor that has the values you want to apply.
Set-Acl applies the security descriptor that is supplied. It uses the value of the AclObject parameter as a model and changes the values in the item’s security descriptor to match the values in the AclObject parameter.
These Commands are a part of Microsoft.PowerShell.Security PSSnapin
Here im showing an example to change permissions on a folder data placed on my c: drive.
First lets see the current permissions on the folder
Get-Acl C:data
<#To change the ACL of a file, use the Set-Acl cmdlet. This example prevents the TempUser Account from write-permissions on a folder:#> $acl = Get-Acl C:data $arguments = "Hyper-V12-5TempUser","Write","Deny" $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $arguments $acl.SetAccessRule($accessRule) $acl | Set-Acl C:data
<#Now if i again check i see that the folder permissions have been changed
and TempUser Account has been denied to write in a file #>
Get-Acl C:data
if we have multiple folders under C:data how do we inheritance permissions to the sub folders & files which are under C:data
I have added this to the arguments line for inheritance:
$arguments = "Domain$Userlogin","FullControl", "ContainerInherit, ObjectInherit", "None", "Allow"
I found it here, so credits for the publisher:
http://powershell.nicoh.me/powershell-1/files-and-folders/set-folders-acl-owner-and-ntfs-rights
the new website is here with the correct article : http://www.shellandco.net/set-folders-acl-owner-and-ntfs-rights/
This seemed to work, but it was unreliable. OS X seemed to drop the connection and it took some time to reestablish it with a connection dialog that defaulted to username/password. I had to switch to guest.free file sharing
I see you don’t monetize your site, don’t waste your traffic, you can earn extra cash every month because you’ve got high quality content.
If you want to know how to make extra money, search for: Ercannou’s essential adsense alternative