Oct 05 2022 08:11 AM
Our goal is simple: Manipulate the registry as part of application deployment or PowerShell script.
Use case: When we install our VPN client, there are a raft of registry updates that need to be made to configure it for use in our environment. The easiest way of doing this is simply by importing a .reg file we've created.
The problem that I just can't seem to overcome is how to import a .reg file using PowerShell as part of an Intune deployment. For testing purposes, I've created a simple test registry file and I'd ideally like to use a PS script that simply has the command "reg.exe import .\1Test.reg" in it. The command runs perfectly from CLI but when I try pushing it as part of a Win32 app, it fails. When I build in other diagnostic steps, everything in the script runs perfectly except for the actual import. I've tried using the script to create a temporary directory, copy the files to it, set it as the working directory, and importing from there in case there were path issues. Everything works perfectly all the way up to the actual import, which never works.
I've tried using "regedit.exe /silent" as well as "reg.exe" and I've spun it off as a separate process; nothing seems to work. I think it needs to run in the user instead of system context so I've tried both of those. I'm currently at a 100% failure in my ability to figure this out and I'm hoping that someone out there in the community has dealt with this and knows the incredibly simple secret and can demystify it for me.
Thanks in advance for your help!
Oct 05 2022 08:23 AM
Oct 05 2022 09:11 AM
Oct 05 2022 09:15 AM
Oct 05 2022 01:14 PM
Oct 05 2022 01:55 PM
Oct 05 2022 02:21 PM
Mar 04 2023 08:25 PM - edited Mar 04 2023 08:27 PM
I am in the exact situation you were in, but the difference is I cannot seem to make it work. Do you have a PS1 script I can test in intune, please?
Mar 06 2023 09:35 AM
Oct 02 2023 02:57 PM - last edited on Nov 08 2023 06:38 PM by Jimmy_Wu
Hello @joemclain
I'm dealing with something similar.
You have already made the script. I have a question, The installation commands within Intune are these: powershell.exe -ExecutionPolicy Bypass -File .\TestReg.ps1 or how did you place them?
Nov 27 2023 03:09 AM
You can easily Create registry keys using the Intune remediations method or via a Powershell script.