FirstLogonCommands in unattend.xml do not work

Discussion in 'Windows 10' started by rwayboy, Jun 12, 2021.

  1. rwayboy

    rwayboy MDL Novice

    May 17, 2017
    37
    4
    0
    #1 rwayboy, Jun 12, 2021
    Last edited: Jun 12, 2021
  2. Option4 Must Work
    Does the same pwsh command work if you run it on an online system.
     
  3. rwayboy

    rwayboy MDL Novice

    May 17, 2017
    37
    4
    0
    Yes, it works. In fact, all of the commands I have mentioned in my post work on an online system.
     
  4. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,394
    11,615
    240
    Been years since I've played with this, but one thing I will say is that there is a software lock on the channel of the installation.
    Someone with more knowledge can chime in but I seem to recall some rule where it simply won't run any unattended script if you use an OEM key or something like that.
     
  5. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    47,023
    93,849
    450
    Afaik, setupcomplete won't work when oem key is used, dunno about unattend xml.
     
  6. Absolutely correct any post oobe script wont run if OEM key is used .
    User must use KMS key or Generic Install key for scripts to run via post oobe process.
     
  7. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    47,023
    93,849
    450
    Or simply an ei.cfg like the generic one from the MRP project:
    Code:
    [Channel]
    _Default
    [VL]
    0
    
     
  8. rwayboy

    rwayboy MDL Novice

    May 17, 2017
    37
    4
    0
    I always use an ei.cfg file to be honest, but since the image I am using at the moment is an AIO image, I forgot to put it (because the tool that I use to create the AIO image deleted the ei.cfg). But anyway, I have tried placing an ei.cfg file in the image without success. Although, when I check the setupact.log file in "C:\Windows\Panther\UnattendGC" I see these lines:

    Code:
    2021-06-12 15:52:33, Info                         [Shell Unattend] Running 'oobeSystem' pass
    2021-06-12 15:52:33, Info                         [Shell Unattend] LogonCommands: Set command '%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe Set-ExecutionPolicy RemoteSigned -Force; tzutil /s 'GTB Standard Time'; set-culture en-GB; $LanguageList = Get-WinUserLanguageList; $LanguageList.Add('el-GR'); Set-WinUserLanguageList $LanguageList -Force; Powercfg /Change standby-timeout-ac 0; Powercfg /Change standby-timeout-dc 0;'
    2021-06-12 15:52:33, Info                         [Shell Unattend] Exiting 'oobeSystem' pass with status 0x00000000
    Does this mean that the command is processed?

    I have attached the file in case someone wants to see it. Thanks.
     

    Attached Files:

  9. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,394
    11,615
    240
    I'm not familiar with the that log file, but typically when a program runs it will return error code 0 if there are no errors, so that looks like it supposedly ran in the background with no errors.
    Someone can correct me if I'm wrong, but I think my brain is screwed in correctly this morning.