Using PS to Add a Key to the Registry
In a recent experiment, I had to disable User Account Control (UAC) on a remote Virtual Machine through WinRM.
To better protect those users who are members of the local Administrators group, we implemented UAC restrictions on the network. This mechanism helps prevent against “loopback” attacks. This mechanism also helps prevent local malicious software from running remotely with administrative rights.
Whenever I deal with the registry, I always feel like the guy in the picture above. You never know if you’re going to regret making changes…
Anyway, this was an experiment, so please, use this wisely.
$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" $Name = "LocalAccountTokenFilterPolicy" $value = "1" New-ItemProperty -Path $registryPath ` -Name $name ` -Value $value ` -PropertyType DWORD ` -Force | Out-Null # Restart the VM to apply the changes Restart-Computer -Force