Windows 10: FirstLogonCommands in unattend.xml do not work

Discus and support FirstLogonCommands in unattend.xml do not work in Windows 10 Support to solve the problem; Hello. I have created an unattend answer file to be used with a windows 10 image and I am experiencing an issue. I have placed a powershell command... Discussion in 'Windows 10 Support' started by rwayboy, Jun 12, 2021.

  1. rwayboy Win User

    FirstLogonCommands in unattend.xml do not work


    Hello. I have created an unattend answer file to be used with a windows 10 image and I am experiencing an issue. I have placed a powershell command under the "FirstLogonCommands" but it is never run. Here is my answer file: HTML Code: <?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="oobeSystem"> <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <InputLocale>en-US</InputLocale> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UILanguageFallback>en-US</UILanguageFallback> <UserLocale>en-US</UserLocale> </component> <component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <InputLocale>en-US</InputLocale> <SystemLocale>en-US</SystemLocale> <UILanguage>en-US</UILanguage> <UILanguageFallback>en-US</UILanguageFallback> <UserLocale>en-US</UserLocale> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <OOBE> <HideEULAPage>true</HideEULAPage> <HideOnlineAccountScreens>true</HideOnlineAccountScreens> <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> <ProtectYourPC>1</ProtectYourPC> <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> </OOBE> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <CommandLine>Powershell -Command "Set-ExecutionPolicy RemoteSigned -Force; $LanguageList = Get-WinUserLanguageList; $LanguageList.Add('el-GR'); Set-WinUserLanguageList $LanguageList -Force; tzutil /s 'GTB Standard Time'; set-culture en-GB; Powercfg /Change standby-timeout-ac 0; Powercfg /Change standby-timeout-dc 0;"</CommandLine> <Description>Add Greek language to input languages, Set time zone to UTC+02:00, Set region to en-GB (User Locale), Change Sleep settings to "Never"</Description> <Order>1</Order> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> </FirstLogonCommands> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <OOBE> <HideEULAPage>true</HideEULAPage> <HideOnlineAccountScreens>true</HideOnlineAccountScreens> <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> <ProtectYourPC>1</ProtectYourPC> <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> </OOBE> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <CommandLine>Powershell -Command "Set-ExecutionPolicy RemoteSigned -Force; $LanguageList = Get-WinUserLanguageList; $LanguageList.Add('el-GR'); Set-WinUserLanguageList $LanguageList -Force; tzutil /s 'GTB Standard Time'; set-culture en-GB; Powercfg /Change standby-timeout-ac 0; Powercfg /Change standby-timeout-dc 0;"</CommandLine> <Description>Add Greek language to input languages, Set time zone to UTC+02:00, Set region to en-GB (User Locale), Change Sleep settings to "Never"</Description> <Order>1</Order> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> </FirstLogonCommands> </component> </settings> </unattend> What bothers me is, that when I manually run that command after OOBE finishes, the command is executed perfectly. I have also tried replacing that command with: 1. cmd.exe /c powershell -command "COMMANDS" 2. powershell .exe COMMANDS (without quotes) 3. %WINDIR%\System32\cmd.exe /c powershell -Command "COMMANDS" 4. %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe COMMANDS (without quotes) Nothing seems to work and I cannot understand why. All the other sections in the answer file are processed correctly without any issues. Also, I am trying to avoid creating a batch file that has the script inside, since I only want to use just one answer file to execute a simple powershell command. Any help would be highly appreciated. Thanks.

    :)
     
    rwayboy, Jun 12, 2021
    #1

  2. Unattend xml File....

    hiiii

    i would like to install windows via WDS Server. How To Create Unattend .XML File in Server 2012......

    Regard

    Mohit
     
    Mohit Bahirat, Jun 12, 2021
    #2
  3. SkyNet3 Win User
    Windows 10 XML file generator for unattended setup

    Anyone ran across a Windows 10 XML file generator for unattended setup? That Works!!!*Biggrin
     
    SkyNet3, Jun 12, 2021
    #3
  4. nomaxtech Win User

    FirstLogonCommands in unattend.xml do not work

    Unattended setup (Sysprep & unattend.xml) is not working for me

    Haha! Kari, I'd like to buy you a another nice bottle of whiskey for helping me out here. This is driving me nuts! I have a friend in England. I'm sure she's fast asleep.

    Anyway, I swear that answer file came directly from the WSIM tool!

    I made new install image with the brand new answer file (pasted above) created exactly as instructed by your tutorial (no validation errors!) and this is what I got...


    FirstLogonCommands in unattend.xml do not work [​IMG]


    FirstLogonCommands in unattend.xml do not work [​IMG]


    FirstLogonCommands in unattend.xml do not work [​IMG]


    FirstLogonCommands in unattend.xml do not work [​IMG]


    FirstLogonCommands in unattend.xml do not work [​IMG]


    FirstLogonCommands in unattend.xml do not work [​IMG]


    It boots all the way to the desktop this time! Still not unattended though. Nothing can ever be easy...
     
    nomaxtech, Jun 12, 2021
    #4
Thema:

FirstLogonCommands in unattend.xml do not work

Loading...
  1. FirstLogonCommands in unattend.xml do not work - Similar Threads - FirstLogonCommands unattend xml

  2. Unattended working mode, the computer automatically restarts

    in Windows 10 Software and Apps
    Unattended working mode, the computer automatically restarts: HelloUnattended working mode, the computer automatically restarts, and the reason for the restart cannot be found in the windows event log. I uploaded the dmp file and hope to get your help.The OS was reinstalled in less than 3 hoursI have another 7 computers with the same...
  3. XML Files

    in Windows 10 Software and Apps
    XML Files: Hi folks! Just registered to this forum and glad to have found it. So I was installing Ubuntu on my computer which already had windows 10.I wanted to have a dual OS. Things went south and windows got deleted/ over written or whatever. I used a hard drive recovery device to...
  4. Unattended sleep timer stopped working

    in Windows 10 Performance & Maintenance
    Unattended sleep timer stopped working: I have a Windows 10 Pro installation that has the Unattended Sleep Timeout value set visible in Power settings and a timeout value of 10mins. The computer has a scheduled task to wake at 05:00 each day and perform a backup which takes about 3-4 minutes. For the past year...
  5. Unattended setup (Sysprep & unattend.xml) is not working for me

    in Windows 10 Installation and Upgrade
    Unattended setup (Sysprep & unattend.xml) is not working for me: I've been trying to create a customized Win10 Pro (Build 1903) install image for the last week or so. No matter how many tutorials I follow, answer files I create, or installs I perform, I just cannot get it to work properly. Every time I go to install Windows from my custom...
  6. Unattend File

    in Windows 10 Installation and Upgrade
    Unattend File: Hi, I'm using WDS with Unattend File to deploy Win 10 to my VMs. It works fine, but the problem is, after the installation, the VM restarts and then boots from PXE again. (Basically, it's an infinite loop of Win 10 Installation because of the restart). What options do I have...
  7. xml

    in Windows 10 Customization
    xml: what is xml and how can I modify it. My windows media player was working alright then it stopped. When I did troubleshooting, I was told a software has changed the XML to SXL. Any help?...
  8. unattend xml not wiping drives / unable to create primary

    in Windows 10 Drivers and Hardware
    unattend xml not wiping drives / unable to create primary: I'm having an issue where the paritions are created, but something goes wrong and then I have to format the primary drive to install windows onto. It's a UEFI config, does anyone have any suggestions? 109354
  9. Windows 10 XML file generator for unattended setup

    in Windows 10 Installation and Upgrade
    Windows 10 XML file generator for unattended setup: Anyone ran across a Windows 10 XML file generator for unattended setup? That Works!!!*Biggrin 5106
  10. FirstLogonCommands only works on 32bit architecture

    in Windows 10 Installation and Upgrade
    FirstLogonCommands only works on 32bit architecture: I've got 2 Windows installations which are identical, the same settings, the same programs. The only difference is that the Windows architecture is different, the one is 32bit and the other one is 64bit. When having sysprepped my 32bit installation with the following...