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.
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
Post Details
- Posted
- 5 months ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Intune/comm...