Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

5
Deploying HKCU Registry Keys. I have tried with PSADT But am having issues. Looking for other options
Post Flair (click to view more posts with a particular flair)
Post Body

EDIT: after playing around with remediation scripts I have got it to work via remediation. Thanks for all your comments

So I have been tasked with hiding certain control panel icons. I have modified the Deploy-Application.ps1 file to do everything I want.

In the Install steps it does this

$RegSettings = {
                Set-RegistryKey -Key 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowCPL' -Name 'Security and Maintenance' -Value 'Security and Maintenance'
                Set-RegistryKey -Key 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Name 'DisallowCPL' -Value 1 -Type 'DWord'
                }

            # Invoke the registry settings for all users
                Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $RegSettings

In the Uninstall steps it does this

$RemoveRegSettings = { 
            Remove-RegistryKey -Key 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Recurse
            }

            # Invoke the registry settings for all users
            Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $RemoveRegSettings

```

This is my detection Script

$Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"

Try {
    # Check if the registry key exists
    $RegistryKey = Get-Item -Path $Path -ErrorAction Stop
    If ($RegistryKey) {
        Write-Output "Detected"
        Exit 0
    } 
    Exit 1
} 
Catch {
    Exit 1
}

When I run the Deploy-Application.exe from commandline on my machine, the relevant registry keys are created and are removed with the uninstall switch.

When I package this up into an intune win file for intune, The application runs successfully, The detection script exits with code 0

But the keys are not created.

I dont know why this is the case. Im using the same installation command on my own machine but the keys are not created on my intune device

Anyone have any ideas? or other options for deploying HKCU Registry keys?

Thanks

Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
45,840
Link Karma
35,921
Comment Karma
8,889
Profile updated: 2 days ago
Posts updated: 4 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
5 months ago