Jan 23 2021 11:38 PM - edited Jan 24 2021 12:03 AM
To whom it may concern,
Please excuse me but I believe the post belongs here not in the PowerShell discussion.
I deleted the post placed in the PowerShell group
Background:
The code is here.
#Adobe DC Reader feature lockdown
#Call the registry value and then set the value. If the value doesnt exit app not installed so exit
#Updated 24-01-2021 and tested on machine with Adobe DC installed - MDM is failing where program doesnt exist
If (Get-ItemProperty -Path 'Registry::HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\DC\FeatureLockDown')
{
#If the key already exists just set the value
Write-Output "True"
Set-Itemproperty -Path 'Registry::HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\DC\FeatureLockDown' -Name 'bDisableJavaScript' -value '1'
Set-Itemproperty -Path 'Registry::HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\DC\FeatureLockDown' -Name 'bEnableFlash' -value '0'
Get-ItemProperty -Path 'Registry::HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\DC\FeatureLockDown'
}
else
{
#If the key doesnt exist then the program is not installed and doesnt need rectification
Write-Output "False"
}
Although it is not a Biggy
You can see the result in Endpoint Manager here.
Thanks in advance. I'm sure its programming but as I said I have another 5 of these that are roughly the same sort of coding format, and I am not getting the same issues.
Feb 10 2021 04:11 AM
SolutionHello @braedachau,
the issue is caues by the if condition, the path you try to check cannot be found because it does not exist when Adobe DC is not installed. (I believe that the registries have not been set by Adobe DC then.)
Try it with "Test-Path"
Example:
#Check path
If (Test-path -Path 'Registry::HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\DC\FeatureLockDown')
{}
Feb 10 2021 04:34 AM
Mar 31 2021 09:57 AM
Mar 31 2021 04:39 PM
Mar 31 2021 06:18 PM
Mar 31 2021 10:16 PM
Travis I just realized something that you need to know.
If you use PowerShell to manage devices, the controls will remain in place after the machine is offboarded. So if the machine is a BYOD and the client disengages from the tenant he/she will be stuck with the changes in the registry, without a clean install..
This could be a problem.
Regards
Feb 10 2021 04:11 AM
SolutionHello @braedachau,
the issue is caues by the if condition, the path you try to check cannot be found because it does not exist when Adobe DC is not installed. (I believe that the registries have not been set by Adobe DC then.)
Try it with "Test-Path"
Example:
#Check path
If (Test-path -Path 'Registry::HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\DC\FeatureLockDown')
{}