Jump to content
DeployCentral
GuyE

FirstLogon Script not Running

Recommended Posts

Hi, I've recently updated MDT from 8450 to 8456, SmartDeploy from 3040 to 3060 and built a Windows 10 1909 image from scratch in same way as I've done previously with 1803. The SmartDeploy answer file specifies a PostImage script that copies various files to the deployed image for further configuration. This works. The answer file also specifies a FirstLogon script that runs a StartMenu/Taskbar modification script and a computer naming/domain join script. The FirstLogon script doesn't seem to run now though.

The answer file and scripts are all ones I've used successfully before. I've triple-checked for typos and syntax errors. I tried modifying the answer file and including a simple FirstLogon file copy as a test, but the file wasn't copied.

This is the relevant part of the answer file including the test copy in the middle task:
      <tasks>
        <task>
          <phase>POSTIMAGE</phase>
          <command>cmd.exe /c Z:\configfiles\sd_postimage_bas.cmd</command>
        </task>
        <task>
          <phase>FIRSTLOGON</phase>
          <command>cmd.exe /c copy C:\windows\setup\sd_firstlogon_bas.cmd C:\Platform\testcopy.cmd</command>
        </task>
        <task>
          <phase>FIRSTLOGON</phase>
          <command>cmd.exe /c C:\windows\setup\sd_firstlogon_bas.cmd</command>
        </task>
      </tasks>

 

This is the sd_firstlogon_bas.cmd script called in the 3rd task above:
@echo off
REM SmartDeploy FirstLogon - BAS
cmd.exe /c C:\windows\setup\starttaskbar_import_bas.cmd
cmd.exe /c C:\windows\setup\computernamedomainjoin.cmd

Previously the image would deploy and the first logon was as the local Administrator with manual password input. The FirstLogon script ran during this logon and the desktop came up with the computername/domain join script paused waiting for input. Not now.

Stumped. Any help appreciated. Thanks.

Share this post


Link to post
Share on other sites

Hi Guy,

When you run tasks during the same phase (such as your two FIRSTLOGON tasks), they don't necessarily run in the order you've specified, and one does not wait until the other has completed before running. So it's possible that your command to copy the script from C:\Windows\Setup to C:\Platform is not finishing before Windows attempts to run the other command, so it's failing because it can't find the script.

You could put the copy command into FIRSTBOOT instead, but I'm not quite clear on why it's necessary at all. I assume that sd_postimage_bas.cmd is copying it into C:\Windows\Setup in the first place? Is there any reason why it couldn't just be copied directly to C:\Platform? (in WindowsPE, this would be T:\Platform, but it's the same folder), or (alternately) executed directly from C:\Windows\Setup?

It just seems to me that the copy command is an unnecessary point of failure.

Glenn
SmartDeploy Support

Share this post


Link to post
Share on other sites

Hi Glen, The middle task that copies the file to C:\Platform was just a test I added in to see if I could get anything to run in FirstLogon. I chose the Platform folder to avoid possible Windows permissions issues. It doesn’t run - no file is copied. The task has no significance to the workflow though. The 3rd task is the important one, but it also doesn’t run.

There is another script run earlier as a PostImage task, from the same answer file, that copies several files from the SmartDeploy server to C:\Windows\Setup ready for the FirstLogon task, including sd_firstlogon_bas.cmd. I can see in the deployed image later on that they’re all there ready to go. I just cant seem to get the 3rd task to execute.

 

Share this post


Link to post
Share on other sites

Hi Guy,

Ah, understood. In that case, we'll want to have a look at a logset from this deployment. I'll reach out to you via email with instructions.

Glenn
SmartDeploy Support
 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...