PowerShell: Grant Current User Full Access to File or Folder
# Grant Current User Full Access to Object $object='C:\temp' $acl=Get-Acl $object $currentUser=[System.Security.Principal.WindowsIdentity]::GetCurrent().Name $grantAccess=New-Object System.Security.AccessControl.FileSystemAccessRule("$currentUser","FullControl","Allow") $acl.AddAccessRule($grantAccess)…
0 Comments