<# .SYNOPSIS PowerShell Script to Add User to NTFS ACL .DESCRIPTION Required - Set Identiy Required - Set MyDir (Folder Path) Creates an ACE and Assigns to Folder Assigns Full Control Keeps Inheritance .Author Scott Head ScriptsbyScott.com #> # //// Create the Access Control Entry \\\\ #Assign User or Group $identity = 'SCott\Test' #assign Directory to Change Permissions on $MyDir = "C:\Temp" #Set the Rights the Account will have $rights = 'FullControl' #Set to allow inheritance still $inheritance = 'ContainerInherit, ObjectInherit' #Will Propagate to subfolder as long as inheritance isn't broken $propagation = 'None' #Set and Allow vs Disallow $type = 'Allow' #builds the Access Control Entry $ACE = New-Object System.Security.AccessControl.FileSystemAccessRule($identity,$rights,$inheritance,$propagation, $type) #Pulls in the Current Access Control List $Acl = Get-Acl -Path $MyDir #Command to Insert access control entry into current access control list $Acl.AddAccessRule($ACE) #Sets the Access Control List onto the Dir Set-Acl -Path $MyDir -AclObject $Acl