yngdiego Posted January 23, 2011 Share Posted January 23, 2011 (edited) 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 January 23, 2011 by yngdiego Link to comment Share on other sites More sharing options...
yngdiego Posted January 23, 2011 Author Share Posted January 23, 2011 (edited) 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 January 23, 2011 by yngdiego Link to comment Share on other sites More sharing options...
maxXPsoft Posted January 23, 2011 Share Posted January 23, 2011 look at FirstLogonCommands in the Unattend.chm for moreIf you create a user account that does not include administrative privileges, the commands may not be executed: Link to comment Share on other sites More sharing options...
yngdiego Posted January 24, 2011 Author Share Posted January 24, 2011 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now