Jump to content

FirstlogonCommands broke in OOBE


Recommended Posts

I'm ripping my hair out trying to get dog gone firstlogoncommands to run during a Windows 7 Enterprise edition autounattend.xml installation in the OOBESystem section. Code excerpt is below:

<FirstLogonCommands>

<SynchronousCommand wcm:action="add">

<Order>1</Order>

<CommandLine>regedit /s c:\windows\setup\scripts\image_registry.reg</CommandLine>

<Description>Configures registry settings</Description>

<RequiresUserInput>false</RequiresUserInput>

</SynchronousCommand>

<SynchronousCommand wcm:action="add">

<Order>2</Order>

<Description>Image lockdown</Description>

<RequiresUserInput>false</RequiresUserInput>

<CommandLine>cmd.exe /c powershell.exe "c:\Windows\setup\scripts\image_lockdown.ps1 > c:\Windows\setup\scripts\image_lockdown.log"</CommandLine>

</SynchronousCommand>

</FirstLogonCommands>

No matter what I do, these commands do not run. I've confimed the path to the registry file exists, as that's include in my $OEM$ directory. I can manually run the command after the system installs, and the registry value is changed. The powershell script is not running either, but that could be because the registry mod to set powershell security to remotesigned is not being set because command #1 is broke.

Ideas? I've done a ton of research, and everything I've seen shows this should work without flaw. I've spent the better part of an entire day trying various things without any success.

Edited by yngdiego
Link to comment
Share on other sites


I also tried a very simple command like "mkdir c:\test" in the OOBE system, and it does NOT get executed. However, it looks as though when the commands are in the specialize section, they DO get executed.

Edited by yngdiego
Link to comment
Share on other sites

I also tried a very simple command like "mkdir c:\test" in the OOBE system, and it does NOT get executed. However, it looks as though when the commands are in the specialize section, they DO get executed.

I found the issue. When in "audit" mode most of the OOBESystem directives are ignored, including any commands. The solution was to use step 6, AuditUser to add the commands, which are run in audit mode.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...