-
Notifications
You must be signed in to change notification settings - Fork 191
Expand file tree
/
Copy pathDisablePromptOnSecureDesktop.ps1
More file actions
35 lines (28 loc) · 1005 Bytes
/
DisablePromptOnSecureDesktop.ps1
File metadata and controls
35 lines (28 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<#
Version: 1.0
Author: Oliver Kieselbach (oliverkieselbach.com)
Script: DisablePromptOnSecureDesktop.ps1
Description:
The script disables the UAC prompt on the secure desktop.
The deactivation enables tools like Quick Assist to work with elevation (UAC) prompts.
Release notes:
Version 1.0: Original published version.
The script is provided "AS IS" with no warranties.
#>
$PromptOnSecureDesktop = (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System).PromptOnSecureDesktop
if ($PromptOnSecureDesktop -ne 0) {
$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\"
$registryKey = "PromptOnSecureDesktop"
$registryValue = 0
try
{
Set-ItemProperty -Path $registryPath -Name $registryKey -Value $registryValue -ErrorAction Stop
$exitCode = 0
}
catch
{
Write-Error -Message "Could not write regsitry value" -Category OperationStopped
$exitCode = -1
}
}
exit $exitCode