Created
March 23, 2018 03:44
-
-
Save andrewtchilds/64de720eaf315d6d247d21b0f48d3920 to your computer and use it in GitHub Desktop.
Repairs the MpsSvc service registry key permissions... if they're missing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$keyPath = "SYSTEM\CurrentControlSet\Services\MpsSvc\Parameters\AppCs" | |
$permissionCheck = [Microsoft.Win32.RegistryKeyPermissionCheck]::ReadWriteSubTree | |
$registryRights = [System.Security.AccessControl.RegistryRights]::ChangePermissions | |
$key = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($keyPath,$permissionCheck,$registryRights) | |
$acl = $key.GetAccessControl() | |
if(-not ($acl.Access | ? { $_.IdentityReference.Value -eq "NT SERVICE\MpsSvc" }) ) { | |
$rule = [System.Security.AccessControl.RegistryAccessRule]::new("NT SERVICE\MpsSvc","SetValue, CreateSubKey, Delete, ReadKey","ContainerInherit","None","Allow") | |
$acl.SetAccessRule($rule) | |
$key.SetAccessControl($acl) | |
} | |
if((Get-Service MpsSvc).Status -ne "Running") { | |
Start-Service MpsSvc | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See: https://community.ivanti.com/message/280508#280508