Тёмный

PowerShell S2E58 (Set Permissions) 

Mr Automation
Подписаться 1,6 тыс.
Просмотров 791
50% 1

(How to set permissions on registry, even when you dont have access)
In this video I demonstrate 2 scenario's for setting registry permissions with powershell, the first scenario is a very simple one, the second example is about a user who lost access to the registry key and we need to restore the permissions and ownership.
Make sure you download setacl.exe (64 bits) and place it in the c:\Windows\system32 folder.
*powershell
*learn powershell
*automation
*learn automation
*windows
*windows powershell
*automatic installations
*set registry permissions with powershell
*take ownership of registry keys
*change permissions on registry with powershell
Code:
Simple script
$subkey = "SOFTWARE\mark\wrong"
$good = get-acl "HKLM:\SOFTWARE\mark\good"
$pathwrong = "HKLM:\$subkey"
$newacl = get-acl -Path $pathwrong
$newacl.SetSecurityDescriptorSddlForm($good.Sddl)
set-acl -path $pathwrong -AclObject $newacl
Script when no access (you need to downloads setacl.exe!)
$subkey = "SOFTWARE\mark\wrong"
$owner = "Administrators"
SetACL.exe -on "HKEY_LOCAL_MACHINE\$subkey" -ot reg -actn setowner -ownr "n:$owner" -rec Yes
SetACL.exe -on "HKEY_LOCAL_MACHINE\$subkey" -ot reg -actn ace -ace "n:$owner;p:full" -rec Yes
$good = get-acl "HKLM:\SOFTWARE\mark\good"
$pathwrong = "HKLM:\SOFTWARE\mark\wrong\"
$newacl = get-acl -Path $pathwrong
#here we need to check the owner
$newacl.SetSecurityDescriptorSddlForm($good.Sddl)
set-acl -path $pathwrong -AclObject $newacl

Опубликовано:

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 2   
Далее
PowerShell S2E59 (Reboots)
17:37
Просмотров 968
How many can you smash?🍫 IB : Florin
00:19
Просмотров 3,2 млн
小丑调戏黑天使的后果#short #angel #clown
00:16
PowerShell SE02E67 - Sendkeys remote
27:47
Просмотров 1,1 тыс.
Lecture 1: Course Overview + The Shell (2020)
48:17
Просмотров 750 тыс.
Think Fast, Talk Smart: Communication Techniques
58:20
Learn PowerShell in Less Than 2 Hours
1:48:21
Просмотров 292 тыс.
How To Manage NTFS Permissions With PowerShell
8:22
Просмотров 11 тыс.
How many can you smash?🍫 IB : Florin
00:19
Просмотров 3,2 млн