Windows 10 permission archive in powershell

michelbdec

New Member
Joined
May 6, 2019
Messages
4
what permission archive in powershell?
 

Solution
Something like this would give a user full access. You'd just need to change the Get-ACL and Set-ACL lines to the directory or file you want to change permissions on. and change computername\user to the user you want to grant the access for.

Code:
$ACL = Get-ACL .\Temp\
$Rule = [System.Security.AccessControl.FileSystemAccessRule]::new(@"computername\user",[System.Security.AccessControl.FileSystemRights]::FullControl,[System.Security.AccessControl.AccessControlType]::Allow)
$ACL.Access.AddRule($Rule)
Set-Acl -Path .\Temp\ -AclObject $ACL

Neemobeer

Windows Forum Team
Staff member
Joined
Jul 4, 2015
Messages
8,998
Saying it again it still makes no sense. You want to archive something with Powershell?
 

Neemobeer

Windows Forum Team
Staff member
Joined
Jul 4, 2015
Messages
8,998
Something like this would give a user full access. You'd just need to change the Get-ACL and Set-ACL lines to the directory or file you want to change permissions on. and change computername\user to the user you want to grant the access for.

Code:
$ACL = Get-ACL .\Temp\
$Rule = [System.Security.AccessControl.FileSystemAccessRule]::new(@"computername\user",[System.Security.AccessControl.FileSystemRights]::FullControl,[System.Security.AccessControl.AccessControlType]::Allow)
$ACL.Access.AddRule($Rule)
Set-Acl -Path .\Temp\ -AclObject $ACL
 

Solution
Back
Top