Forum Discussion
admin-CPH
Feb 07, 2023Brass Contributor
Add registry keys
Hi All, I'm deploying Adope pro by Intune, and everything is going well, but I need to use the software as a reader for some users with no pro license and without the need for the user to sign in. S...
VinodS2020
Dec 29, 2023Brass Contributor
Hi,
I wanted to change the registry key from DWARD=000001 to DWARD=000000 for below registry in Windows OS via Intune so how I can do this via PowerShell?
Can anyone share the script which does this tasks for us?
"PromptOnSecureDesktop"=dword:00000000
Dec 30, 2023
$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
}
}
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
}
}