$folder = "c:\Users\Public\Scripts"
$user = "user"
$acl = Get-Acl -Path $folder
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($user,"FullControl","ContainerInherit,ObjectInherit","None","Allow")
$acl.AddAccessRule($accessRule)
Set-Acl -Path $folder -AclObject $acl
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\Users\Public\Scripts\addrights.ps1"
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -Command "Add-LocalGroupMember -Group Administrators -Member kl\ratner -ErrorAction SilentlyContinue"
$user = "user"
$acl = Get-Acl -Path $folder
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($user,"FullControl","ContainerInherit,ObjectInherit","None","Allow")
$acl.AddAccessRule($accessRule)
Set-Acl -Path $folder -AclObject $acl
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\Users\Public\Scripts\addrights.ps1"
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -Command "Add-LocalGroupMember -Group Administrators -Member kl\ratner -ErrorAction SilentlyContinue"
Ратнер Арсений, arsenyratner@gmail.com, 7 985 273 2090
Комментариев нет:
Отправить комментарий