Pages

Thursday, 10 February 2022

read and write permission through powershell

$folder_to_change = "C:\Temp\Aspen"
$acl = Get-Acl "$folder_to_change"
$ar = New-Object System.Security.AccessControl.FileSystemAccessRule("BUILTIN\Users", @("Read", "write"), "ContainerInherit,ObjectInherit", "None", "Allow")
$acl.SetAccessRule($ar)
Set-Acl "$folder_to_change" $acl

No comments:

Post a Comment

Test

   $AppList = Get-InstalledApplication -Name 'Air Explorer'                 ForEach ($App in $AppList)         {         If($App.Uni...

Search This Blog