How to remove an entry from the registry during an MDT deployment

deploymentmdt-2010

I'm working on the well known problem of MDT not wanting to automatically continue because of a legal disclaimer prompt at login. Our disclaimer is set at the domain policy, so I've created a new OU for staging, then blocked inheritance so it doesn't get the GPO. I have MDT set to place the newly built machine in that OU. All of that is fine, the problem is, the machine that I used as my capture machine had the disclaimer locally cached from already being on the network and even being in the proper OU the disclaimer is still there. So I've added a couple lines in MDT to go in and do the following:

REG DELETE hklm\software\microsoft\windows\currentversion\policies\system /v legalnoticetext /f
REG DELETE hklm\software\microsoft\windows\currentversion\policies\system /v legalnoticecaption /f

I've testd them manually and they work just fine to remove the entries and allow the machine to boot up without a prompt. The thing is, I can't find the exact place to place them in the task sequence. I want them to run before the first login, so I placed them In Postinstall, before the Restart Computer task. That didn't work, gave an error. I tried right before that, before Next Phase, same issue. I try putting them after Restart Computer, but before State Restore and they don't error out, but they don't seem to run until I hit "OK" through the one prompt, then it runs and never prompts again. So it's progress as before it would prompt me to hit "OK" through the disclaimer after every reboot, now I only have to hit it that one time and it removes the line from the cached registry and never prompts again. I just can't figure out how to get it to run before it gets to that first prompt so that it doesn't prompt at all. It's so close to being fully automated… My only other thought is to re-do my capture and run that line first, but I would love to avoid that unless it's my only option left. Thanks for any help or advice you can give.

Best Answer

The steps in the task sequence execute after the local administrator account has logged on and this needs to occur before. I'm not aware of a way around that within the task sequence itself.

You should be able to mount your WIM file and remove those lines using regedit against the registry contained within.

EDIT - I used to mount with dism and use the following command.

reg load HKLM\mounted <mount point>\windows\system32\config\system
Related Topic