Today is: 6 September, 2010

file rights

Adding rights to a file or folder with PowerShell

Pretty straight forward example and reference for adding rights to a folder or file with PowerShell.

Example

$AccessControl = get-acl "D:\My Documents"

$AccessRule = New-Object Security.AccessControl.FileSystemAccessRule("Users", "FullControl", "ContainerInherit, ObjectInherit", "None", "Allow")

$AccessControl.AddAccessRule($AccessRule) set-acl -aclobject

$AccessControl -path "D:\My Documents"

Syndicate content