Using the disallowrun registry in session_setup
Published: November 6, 2024 - 3:47 PM
Hello,
Server:
Version: 2.5.5.15697
OS: Debian 12.7
Client:
Windows 11 23H2
I would like to block specific executables based on the user account.
To do this, I would like to use the command
`registry_setstring(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\DisallowRun", '1', 'powershell.exe', type=REG_SZ)`
to block PowerShell, for example.
However, I get a PermissionError: [WinError 5] Access is denied. The user cannot write to this registry.
Is there a way to work around this and successfully set this registry?
Thank you for your help.
Have a good day.
Server:
Version: 2.5.5.15697
OS: Debian 12.7
Client:
Windows 11 23H2
I would like to block specific executables based on the user account.
To do this, I would like to use the command
`registry_setstring(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\DisallowRun", '1', 'powershell.exe', type=REG_SZ)`
to block PowerShell, for example.
However, I get a PermissionError: [WinError 5] Access is denied. The user cannot write to this registry.
Is there a way to work around this and successfully set this registry?
Thank you for your help.
Have a good day.