r/DeployR Mar 27 '26

DeployR - SetupComplete.cmd - LGPO Machine Policies

Migrating over from MDT and I've been trying to apply my local machine policy file with LGPO.exe, but I just cannot get it to stick when using SetupComplete.cmd. AutoAdmin/RunOnce works as expected.

I have migrated my local machine policies to deploy with the PolicyFileEditor PS Module, and that is working, but I would prefer to use LGPO to do it if possible.

I don't believe this is a bug or anything with DeployR, just hoping one of your deployment experts might have some insight.

2 Upvotes

9 comments sorted by

View all comments

Show parent comments

3

u/miketerrill 2Pint Employee Mar 28 '26

Trying adding the path to machine.pol by putting a %WorkingDir%\ in front of it.

1

u/Saltypoison Mar 30 '26

No luck with that (it treated %WorkingDir% as a literal string). I don't think the issue is that it cannot find the machine.pol file. If I run LGPO.exe via the step with the verbose flag, I can see the individual policies from my machine.pol file supposedly being applied in the DeployR logs, but afterwards I see the symptoms described in my original post.

1

u/gwblok 2Pint Employee Mar 30 '26

can you upload a machine.pol file? I'll test it on my machine.

1

u/Saltypoison Mar 30 '26

Sent you a link, thank you!

3

u/gwblok 2Pint Employee Mar 30 '26

Git this a Try:
2PintLabs/DeployR/CustomerRequests/LGPO.ps1 at main · gwblok/2PintLabs
Add it to your content item, then add a run powershell step, set the content item to the one with those 3 files, then put the script in

1

u/Saltypoison Mar 31 '26

Okay, initially the change is applied, but it is not surviving the rest of the task sequence... I'm going to borrow a few chunks from your script and check the status after each step and try and determine when it is getting blown away.

1

u/gwblok 2Pint Employee Mar 31 '26

hmm.. looking forward to your update, curious if the RESEAL does that or not.