Registry entry via Powershell script - Intune failure to deploy

Matt Pollock 256 Reputation points
2022-12-07T11:37:36.4+00:00

I am trying to deploy the following PS script via the MEM>Devices>Scripts blade

268099-image.png

The script runs perfectly when run locally from my pc via PS - but only as Adminstrator

When the script is deployed via Intune however, the following "Object not found" error is generated in the IntuneManagementExtension log

The script is deployed with the following settings, I have tried running it in both user and system contexts:

268109-image.png

268108-image.png

Any idea how to overcome this?

Thanks

Microsoft Security | Intune | Other
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Simon Skotheimsvik 171 Reputation points MVP
    2022-12-08T00:01:50.893+00:00

    Hi @Matt Pollock

    I have done something similar. Please take a look at my example script shared in GitHub:
    https://github.com/SimonSkotheimsvik/Community-By-SSkotheimsvik/blob/main/Microsoft/Intune/Win11-OEMInformation.ps1

    I hope this can help you on your way for solving this problem.

    Best regards,
    Simon


  2. Simon Skotheimsvik 171 Reputation points MVP
    2022-12-15T06:12:52.713+00:00

    @Matt Pollock ,
    I finally found an example online of how you can change the HKCU branch via Intune. Please check this excellent blog post describing this process:

    https://smbtothecloud.com/powershell-intune-to-edit-hkcu-registry-as-system-when-standard-users-dont-have-permission/?latest

    Best of luck!
    Simon

    0 comments No comments

  3. Simon Skotheimsvik 171 Reputation points MVP
    2022-12-15T06:17:51.077+00:00

    Check this information as well for setting HKCU for all users by use of PSAppDeployToolkit

    https://allnewandimproved.psappdeploytoolkit.com/functions/Invoke-HKCURegistrySettingsForAllUsers.html#synopsis

    Simon

    0 comments No comments

  4. Simon Skotheimsvik 171 Reputation points MVP
    2022-12-20T08:34:31.8+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.