Rui Qiu's Blog
  • Coming Soon
Subscribe
Rui Qiu's Blog
Rui Qiu's Blog
  • SCCM

SCCM Package for Registry Permissions Change

  • April 18, 2018
  • No comments
  • 1 minute read
  • me

Orignally I have Powershell script for doing that, but it turns out not so good:

if (!(Test-Path HKCC:))
{New-PSDrive -PSProvider registry -Root HKEY_CURRENT_CONFIG -Name HKCC}
$RegPath= ”HKCC:\SOFTWARE\XXX”
New-Item -Path ”HKCC:\SOFTWARE\” -Name Encompass -Force
$acl = Get-Acl $RegPath
$rule = New-Object System.Security.AccessControl.RegistryAccessRule (“BUILTIN\Users”,”FullControl”,”Allow”)
$rule2 = New-Object System.Security.AccessControl.RegistryAccessRule (“Everyone”,”FullControl”,”Allow”)
$acl.SetAccessRule($rule)
$acl.SetAccessRule($rule2)

Here is the bath file to do the registry permissions change:

reg add “HKCC\SOFTWARE\XXX” /f
REGPERM /K “HKEY_CURRENT_CONFIG\SOFTWARE\XXX” /A:Everyone:F /E /I /F

Here is the little program can make great registry permission change:

regperm

FYI, I tried to make it as a SCCM application, but it seems to get good and bad result with the detection rule:

if (!(Test-Path HKCC:))
{New-PSDrive -PSProvider registry -Root HKEY_CURRENT_CONFIG -Name HKCC}
$RegPath= “HKCC:\SOFTWARE\Encompass”

if (test-path $RegPath ){
$acl= get-acl $RegPath | select -expandproperty Access | ? {$_.IdentityReference -eq ‘Everyone’}
if($acl.RegistryRights -eq ‘FullControl’)
{write-host “Installed”}}
else
{  }

me

Previous Article
  • SCCM

Fix WPAD Vulnerability by Changing Host File with SCCM

  • April 11, 2018
  • me
View Post
Next Article
  • SCCM

SCCM DP Installation Notes

  • April 18, 2018
  • me
View Post
You May Also Like
View Post
  • Powershell
  • SCCM

Automated Patching for Amazon Workspaces via SCCM and Powershell – Day 1

  • September 30, 2019
  • me
View Post
  • SCCM

How to Find Out If SCCM Rebooted Your Machine?

  • June 6, 2019
  • me
View Post
  • Powershell
  • SCCM

DNS Management Tool Missing in RSAT Windows 10 1809 – SCCM Package

  • May 13, 2019
  • me
View Post
  • SCCM

SCCM Shockwave Uninstaller

  • April 29, 2019
  • me
View Post
  • SCCM

Powershell Script to Find Primary User from McAFee ePo and Feed Data into SCCM Device Affinity

  • November 26, 2018
  • me
View Post
  • SCCM

SCCM Report for User Device Affinity

  • October 29, 2018
  • me
View Post
  • SCCM

Cannot Remove a DP – Old Site System from SCCM

  • September 14, 2018
  • me
View Post
  • Powershell
  • SCCM

Prompt to Rename Computer During Task Sequence via Powershell

  • August 24, 2018
  • me

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Rui Qiu's Blog
SCCM, Powershell, Shell Script, Automation...

Input your search keywords and press Enter.