Jump to content

Difference between FirstLogon & Logon Commands


Recommended Posts

Hi All,

I am testing out different Sysprep configurations to get the most complete unattended install I possibly can. Right now I am using the FirstLogon setting to kick off a few scripts needed to install, activate, etc.. I also have a script kicking off in setupcomplete.cmd (but I would like to have a script to delete/remove certain directories, sysprep files, etc).. Basically what I'm trying to figure out is where I should be placing my scripts for the most efficient unattended install and if using logon vs firstlogon commands differs from one another.

-Justpooped

Link to comment
Share on other sites


FirstLogonCommands run right before GUI loads so it would be a good place to do things you was asking like

If you have a password set and it stops on that screen setupcomplete.cmd run's right before that, FirstLogonCommands run after you type password. It works without password also only telling you where they fire off

            <FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<Description>Password Expires False</Description>
<CommandLine>cmd /C wmic useraccount where "name='MYUSERNAME'" set PasswordExpires=FALSE</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>

Theres also $OEM$\$$\setup\scripts\oobe.cmd which if prersent executes auto

@echo off

start /w regedit /s %systemroot%\setup\scripts\OEMInformation.reg
del /F /Q %systemroot%\setup\scripts\OEMInformation.reg
call %systemroot%\setup\scripts\slp.cmd
del /F /Q %systemroot%\setup\scripts\slp.cmd


:Cleanup
del /F /Q %systemroot%\setup\scripts\oobe.cmd

How to create $OEM$

Edited by maxXPsoft
Link to comment
Share on other sites

When creating a unattend.xml file, Windows System Image Manager (WSIM) is usually the first recommendation. WSIM creates and manages unattended Windows Setup answer files in a graphical user interface (GUI). WSIM is a component of the Windows Automated Installation Kit for Windows 7 (Windows AIK). The download link is included in the provided resource. Also, you can find sample unattend files here.

To address your concerns specifically, FirstLogon commands specifies the commands to run the first time a user logs on to the computer which means these commands are run only once. The following is an XML example of how to set first logon commands:

<FirstLogonCommands>

<SynchronousCommand wcm:action="add">

<CommandLine>c:synccommands\command1.exe</CommandLine>

<Description>Description_of_command1</Description>

<Order>1</Order>

</SynchronousCommand>

<SynchronousCommand wcm:action="add">

<CommandLine>c:synccommands\command2.exe</CommandLine>

<Description>Description_of_command2</Description>

<Order>2</Order>

</SynchronousCommand>

</FirstLogonCommands>

LogonCommands specifies commands to run asynchronously when the user logs on. Both of these commands are added to the oobeSystem pass of an XML file.

And finally, scripts. First off, it is important to know that by nature the sysprep /generalize command removes unique information from your Windows installation such as system-specific data, including the computer security identifier (SID). To have the sysprep folder removed you might want to follow the steps outlined by jsnyder in this TechNet forums thread.

Jessica

Windows Outreach Team – IT Pro

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...