• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. lebrun78
    3. Posts
    L
    • Profile
    • Following 1
    • Followers 1
    • Topics 53
    • Posts 314
    • Best 11
    • Controversial 0
    • Groups 0

    Posts made by lebrun78

    • RE: CSS Web Customization

      Hello,
      I have a prod server and a test server
      To differentiate them, I would lid like to change the default “blue theme” to a green theme.
      Which lines should I modifi in de fog.css files ?

      posted in FOG Problems
      L
      lebrun78
    • snapin max timeout

      Hello,
      What is the max value to timeout parameter for snapin ?

      Arnaud

      posted in FOG Problems
      L
      lebrun78
    • RE: BdsDxe: failed to load Boot0004 "UEFI PSEx4 mac" from PCIRoot: Access Denied

      To enter bios of the VM, use F2 key on boot, then you can disable secure boot

      posted in General Problems
      L
      lebrun78
    • auto logout doesn't work, no log

      Hello
      I would like to use auto logout service .

      It seems not working
      I have no trace of this service on my client logs.

      On my server setting, I have CLIENT AUTOLOGOFF BGIMAGE set to “c:\program files\fog\images\alo-bg.jpg” but client works under “C:\Program Files (x86)\fog”

      ------------------------------------------------------------------------------
      ----------------------------------UserTracker---------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:09:04 Client-Info Client Version: 0.13.0
       26/10/2023 15:09:04 Client-Info Client OS:      Windows
       26/10/2023 15:09:04 Client-Info Server Version: 1.5.10
       26/10/2023 15:09:04 Middleware::Response Module is disabled globally on the FOG server
      ------------------------------------------------------------------------------
      
       26/10/2023 15:09:05 Service Sleeping for 149 seconds
       26/10/2023 15:11:34 Middleware::Communication URL: https://fogus/fog/management/index.php?sub=requestClientInfo&configure&newService&json
       26/10/2023 15:11:34 Middleware::Response Success
       26/10/2023 15:11:34 Middleware::Communication URL: https://fogus/fog/management/index.php?sub=requestClientInfo&mac=14:B3:1F:02:4E:FF&newService&json
       26/10/2023 15:11:34 Middleware::Response Success
       26/10/2023 15:11:34 Middleware::Communication URL: https://fogus/fog/service/getversion.php?clientver&newService&json
       26/10/2023 15:11:34 Middleware::Communication URL: https://fogus/fog/service/getversion.php?newService&json
      
       26/10/2023 15:11:34 Service Creating user agent cache
       26/10/2023 15:11:34 Middleware::Response Success
       26/10/2023 15:11:34 Middleware::Response Module is disabled globally on the FOG server
       26/10/2023 15:11:34 Middleware::Response Module is disabled on the host
      
      ------------------------------------------------------------------------------
      ---------------------------------ClientUpdater--------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:11:34 Client-Info Client Version: 0.13.0
       26/10/2023 15:11:34 Client-Info Client OS:      Windows
       26/10/2023 15:11:34 Client-Info Server Version: 1.5.10
       26/10/2023 15:11:34 Middleware::Response Success
      ------------------------------------------------------------------------------
      
      
      ------------------------------------------------------------------------------
      ----------------------------------TaskReboot----------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:11:34 Client-Info Client Version: 0.13.0
       26/10/2023 15:11:34 Client-Info Client OS:      Windows
       26/10/2023 15:11:34 Client-Info Server Version: 1.5.10
       26/10/2023 15:11:34 Middleware::Response Success
      ------------------------------------------------------------------------------
      
      
      ------------------------------------------------------------------------------
      --------------------------------HostnameChanger-------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:11:34 Client-Info Client Version: 0.13.0
       26/10/2023 15:11:34 Client-Info Client OS:      Windows
       26/10/2023 15:11:34 Client-Info Server Version: 1.5.10
       26/10/2023 15:11:34 Middleware::Response Success
       26/10/2023 15:11:34 HostnameChanger Checking Product Key Activation
       26/10/2023 15:11:35 HostnameChanger Already activated with correct key
       26/10/2023 15:11:35 HostnameChanger Users still logged in and enforce is disabled, delaying any further actions
      ------------------------------------------------------------------------------
      
      
      ------------------------------------------------------------------------------
      ---------------------------------SnapinClient---------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:11:35 Client-Info Client Version: 0.13.0
       26/10/2023 15:11:35 Client-Info Client OS:      Windows
       26/10/2023 15:11:35 Client-Info Server Version: 1.5.10
       26/10/2023 15:11:35 Middleware::Response No snapins
      ------------------------------------------------------------------------------
      
      
      ------------------------------------------------------------------------------
      --------------------------------PrinterManager--------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:11:35 Client-Info Client Version: 0.13.0
       26/10/2023 15:11:35 Client-Info Client OS:      Windows
       26/10/2023 15:11:35 Client-Info Server Version: 1.5.10
       26/10/2023 15:11:35 Middleware::Response Module is disabled globally on the FOG server
      ------------------------------------------------------------------------------
      
      
      ------------------------------------------------------------------------------
      --------------------------------PowerManagement-------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:11:35 Client-Info Client Version: 0.13.0
       26/10/2023 15:11:35 Client-Info Client OS:      Windows
       26/10/2023 15:11:35 Client-Info Server Version: 1.5.10
       26/10/2023 15:11:35 Middleware::Response Success
       26/10/2023 15:11:35 PowerManagement Calculating tasks to unschedule
       26/10/2023 15:11:35 PowerManagement Calculating tasks to schedule
      ------------------------------------------------------------------------------
      
      
      ------------------------------------------------------------------------------
      ----------------------------------UserTracker---------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:11:35 Client-Info Client Version: 0.13.0
       26/10/2023 15:11:35 Client-Info Client OS:      Windows
       26/10/2023 15:11:35 Client-Info Server Version: 1.5.10
       26/10/2023 15:11:35 Middleware::Response Module is disabled globally on the FOG server
      ------------------------------------------------------------------------------
      
       26/10/2023 15:11:35 Service Sleeping for 176 seconds
       26/10/2023 15:14:31 Middleware::Communication URL: https://fogus/fog/management/index.php?sub=requestClientInfo&configure&newService&json
       26/10/2023 15:14:31 Middleware::Response Success
       26/10/2023 15:14:31 Middleware::Communication URL: https://fogus/fog/management/index.php?sub=requestClientInfo&mac=14:B3:1F:02:4E:FF&newService&json
       26/10/2023 15:14:31 Middleware::Response Success
       26/10/2023 15:14:31 Middleware::Communication URL: https://fogus/fog/service/getversion.php?clientver&newService&json
       26/10/2023 15:14:31 Middleware::Communication URL: https://fogus/fog/service/getversion.php?newService&json
      
       26/10/2023 15:14:31 Service Creating user agent cache
       26/10/2023 15:14:31 Middleware::Response Success
       26/10/2023 15:14:31 Middleware::Response Module is disabled globally on the FOG server
       26/10/2023 15:14:31 Middleware::Response Module is disabled on the host
      
      ------------------------------------------------------------------------------
      ---------------------------------ClientUpdater--------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:14:31 Client-Info Client Version: 0.13.0
       26/10/2023 15:14:31 Client-Info Client OS:      Windows
       26/10/2023 15:14:31 Client-Info Server Version: 1.5.10
       26/10/2023 15:14:31 Middleware::Response Success
      ------------------------------------------------------------------------------
      
      
      ------------------------------------------------------------------------------
      ----------------------------------TaskReboot----------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:14:31 Client-Info Client Version: 0.13.0
       26/10/2023 15:14:31 Client-Info Client OS:      Windows
       26/10/2023 15:14:31 Client-Info Server Version: 1.5.10
       26/10/2023 15:14:31 Middleware::Response Success
      ------------------------------------------------------------------------------
      
      
      ------------------------------------------------------------------------------
      --------------------------------HostnameChanger-------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:14:31 Client-Info Client Version: 0.13.0
       26/10/2023 15:14:31 Client-Info Client OS:      Windows
       26/10/2023 15:14:31 Client-Info Server Version: 1.5.10
       26/10/2023 15:14:31 Middleware::Response Success
       26/10/2023 15:14:31 HostnameChanger Checking Product Key Activation
       26/10/2023 15:14:33 HostnameChanger Already activated with correct key
       26/10/2023 15:14:33 HostnameChanger Users still logged in and enforce is disabled, delaying any further actions
      ------------------------------------------------------------------------------
      
      
      ------------------------------------------------------------------------------
      ---------------------------------SnapinClient---------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:14:33 Client-Info Client Version: 0.13.0
       26/10/2023 15:14:33 Client-Info Client OS:      Windows
       26/10/2023 15:14:33 Client-Info Server Version: 1.5.10
       26/10/2023 15:14:33 Middleware::Response No snapins
      ------------------------------------------------------------------------------
      
      
      ------------------------------------------------------------------------------
      --------------------------------PrinterManager--------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:14:33 Client-Info Client Version: 0.13.0
       26/10/2023 15:14:33 Client-Info Client OS:      Windows
       26/10/2023 15:14:33 Client-Info Server Version: 1.5.10
       26/10/2023 15:14:33 Middleware::Response Module is disabled globally on the FOG server
      ------------------------------------------------------------------------------
      
      
      ------------------------------------------------------------------------------
      --------------------------------PowerManagement-------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:14:33 Client-Info Client Version: 0.13.0
       26/10/2023 15:14:33 Client-Info Client OS:      Windows
       26/10/2023 15:14:33 Client-Info Server Version: 1.5.10
       26/10/2023 15:14:33 Middleware::Response Success
       26/10/2023 15:14:33 PowerManagement Calculating tasks to unschedule
       26/10/2023 15:14:33 PowerManagement Calculating tasks to schedule
      ------------------------------------------------------------------------------
      
      
      ------------------------------------------------------------------------------
      ----------------------------------UserTracker---------------------------------
      ------------------------------------------------------------------------------
       26/10/2023 15:14:33 Client-Info Client Version: 0.13.0
       26/10/2023 15:14:33 Client-Info Client OS:      Windows
       26/10/2023 15:14:33 Client-Info Server Version: 1.5.10
       26/10/2023 15:14:33 Middleware::Response Module is disabled globally on the FOG server
      ------------------------------------------------------------------------------
      
      
      posted in Windows Problems
      L
      lebrun78
    • RE: HP 640 G10 and HP 650 G10

      @Florent
      Merci ca marche

      posted in Hardware Compatibility
      L
      lebrun78
    • HP 640 G10 and HP 650 G10

      Hello
      With our new HP laptops G10, boot stop on ipxe initialising devices

      We’ve just upgrade ipxe via the https://forums.fogproject.org/topic/15826/updating-compiling-the-latest-version-of-ipxe?_=1689971549331 procedure.
      ipxe version is now g9e99a

      Arnaud

      posted in Hardware Compatibility
      L
      lebrun78
    • RE: problem after deployment with release 1.5.10

      Hello,
      I’m working with CedricoR,
      We don’t have probrem with windows host working with uefi.
      On Ubuntu host, system crash booting refind after pxe. If we choose EXIT in FOG host conf, we have to choose manually booting from harddrive. Then Ubuntu works

      posted in FOG Problems
      L
      lebrun78
    • RE: FOG 1.5.10 officially released

      Hello and thank you for your very useful job ! 👍

      The installation instructions in https://news.fogproject.org/fog-1-5-10-officially-released/ link seams not good.
      The link drives me to installer archive

      Arnaud

      posted in Announcements
      L
      lebrun78
    • RE: powershell snapin no output, non error

      @JJ-Fullmer
      No log film created.
      Task created as you proposed require administrator login to be executed. That is not the purpose of the snapin.
      But I have no idea how to work around the problem 🤕

      @Tom-Elliott
      Do you have any idea how to keep pxe boot with eufi Windows ?

      If I have to get up from my chair every time I have to deploy, that’s no big deal. 😌

      posted in Windows Problems
      L
      lebrun78
    • RE: powershell snapin no output, non error

      @Tom-Elliott
      Yes Tom, I agree,
      That’s why JJ-Fullmer create a task executed as user administrator to modify the boot order.
      I have a powershell problem, to how to create a task trigger at the creation of the task

      posted in Windows Problems
      L
      lebrun78
    • RE: powershell snapin no output, non error

      @JJ-Fullmer
      Thank you for your work, this script runs with snapin but does not do the expected job, the pxe is not ranked àat the good place :

      $adminUsr = "$($ENV:ComputerName)\Administrateur"
      $trigger = New-ScheduledTaskTrigger -AtLogOn -User $adminUsr;
      $settings = New-ScheduledTaskSettingsSet -WakeToRun -Priority 0;
      $principal = New-ScheduledTaskPrincipal -UserId $adminUsr -RunLevel Highest -LogonType Interactive;
      $sb = {
      $firmware = cmd /c "C:\windows\system32\bcdedit.exe" /enum firmware;
      $fullLine = (($firmware | Select-String "IPV4" -Context 1 ).context.precontext)[0];
      $GUID = '{' + $FullLine.split('{')[1];
      $result = cmd /c "C:\windows\system32\bcdedit.exe" /set "{fwbootmgr}" displayorder $GUID /addfirst;
      #make c:\temp if it doesn't exist
      if (!(Test-Path 'C:\temp')) { mkdir 'C:\temp'; }
      #log everything in a new C:\temp\firmware.log file
      New-Item -path C:\temp\firmware.log -itemType File -value "Firmware: $($firmware | out-string)`n`nFullLine: $fullLine`nGUID_ipV4: $GUID`nresult: $result`n" -force;
      }
      
      New-Item C:\netboot.ps1 -value $sb.tostring() -force;
      $action = New-ScheduledTaskAction -Execute "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -Argument "-File C:\netboot.ps1"
      $task = New-ScheduledTask -Action $action -Description "update bcd" -Principal $principal -Trigger $trigger -Settings $settings;
      $taskName = "boot-to-IPV4";
      Register-ScheduledTask -InputObject $task -TaskName $taskName;
      Start-ScheduledTask -TaskName $taskName;
      
      while ((Get-ScheduledTask $taskName).State -eq 'Running') {
          Start-Sleep -Seconds 1;
      }
      Unregister-ScheduledTask -TaskName $taskName -Confirm:$false -EA 0;
      move-Item 'C:\netboot.ps1' 'C:\netbootOLD.ps1' -force -ea 0;
      
      posted in Windows Problems
      L
      lebrun78
    • RE: powershell snapin no output, non error

      @JJ-Fullmer
      I tried command line step by step with psexec, it works
      I tried command line step by step with your modified script, it works
      I tried snapin with

      Snapin Command read-only:
      
      C:\windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy bypass -NoProfile -File boot-uefi-pxe_win.ps1
      

      and with boot-uefi-pxe_win.ps1

      $bcdedit = "C:\windows\System32\bcdedit.exe"
      $firmware = & {start-process -filepath $bcdedit -args "/enum firmware" -Wait -RedirectStandardOutput output.txt ; get-content output.txt; remove-item output.txt}
      $fullLine = (($firmware | Select-String "IPV4" -Context 1 ).context.precontext)[0]
      $GUID = '{' + $FullLine.split('{')[1]
      $result = & {start-process $bcdedit -args "/set `"{fwbootmgr}`" displayorder $GUID /addfirst" -Wait -RedirectStandardOutput output.txt ; get-content output.txt; remove-item output.txt}
      
      # $firmware = $(bcdedit /enum firmware)
      # $fullLine = (($firmware | Select-String "IPV4" -Context 1 ).context.precontext)[0]
      # $GUID = '{' + $FullLine.split('{')[1]
      # $result = $(cmd /c bcdedit /set "{fwbootmgr}" displayorder $GUID /addfirst)
      $dateheure = (date).ToString() 
      if (!(Test-Path 'C:\temp')) { mkdir 'C:\temp' }
      #log everything in a new C:\temp\firmware.txt file
      New-Item -path C:\temp\firmware.txt -itemType File -value "Firmware: $($firmware | out-string)`n`nFullLine: $fullLine`nGUID: $GUID`nresult: $result`ndate: $dateheure`n" -force
      

      And the result is allways 😢

      Get-Content C:\temp\firmware.txt
      Firmware: 
      
      FullLine: 
      GUID: 
      result: 
      date: 03/04/2023 17:30:13
      

      My OS is Windows 11

      posted in Windows Problems
      L
      lebrun78
    • RE: powershell snapin no output, non error

      @JJ-Fullmer
      Running your script step by step works, I don’t understand why it doesn’t work by snapin.
      Is it possible to test a script by the system account used by fog service?

      posted in Windows Problems
      L
      lebrun78
    • RE: powershell snapin no output, non error

      @JJ-Fullmer
      Thank you for your proposition
      I now have the file with the title of each item, but the values are empty I modified by adding the date, just to have a trace

      $firmware = (bcdedit /enum firmware)
      $fullLine = (($firmware | Select-String "IPV4" -Context 1 ).context.precontext)[0]
      $GUID = '{'bcdedit /set "{fwbootmgr}" displayorder $GUID /addfirst)
      $datetime = (date).ToString()
      if (!(Test-Path 'C:\temp')) { mkdir 'C:\temp' }
      #log everything in a new C:\temp\firmware.txt file
      New-Item -path C:\temp\firmware.txt -itemType File -value "Firmware: $($firmware | out-string)`n`nFullLine: $fullLine`nGUID: $GUID`nresult: $result`ndate: $datetime`n" -force
      

      I get

      Firmware:
      
      FullLine:
      GUID:
      result:
      date: 03/04/2023 09:35:36
      

      I tried adding cmd /c > it’s the same

      posted in Windows Problems
      L
      lebrun78
    • RE: powershell snapin no output, non error

      When I run the command

      C:\> powershell.exe -ExecutionPolicy RemoteSigned -NoProfile -File boot-uefi.ps1
      

      I get :

      L'opération a réussi.
      
      posted in Windows Problems
      L
      lebrun78
    • powershell snapin no output, non error

      I try to run the script as snapin

      # Create text file containing firmware settings
      bcdedit /enum firmware > c:\temp\firmware.txt
      
      # Find the line containing "IPV4", and read the line just before that
      $FullLine = (( Get-Content c:\temp\firmware.txt | Select-String "IPV4" -Context 1 ).context.precontext)[0]
      
      # Delete our temporary file
      #del firmware.txt
      
      # Split line into fields using the first left-curly as the delimiter,
      # and then grab the second field (and restore the first left-curly)
      $GUID = '{' + $FullLine.split('{')[1]
      
      # Set the boot order
      #bcdedit /set {fwbootmgr} displayorder $GUID {bootmgr}
      cmd /c bcdedit /set "{fwbootmgr}" displayorder $GUID /addfirst
      
      # SIG # Begin signature block
      # MIIECAYJKoZIhvcNAQcCoIID+TCCA/UCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
      # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
      

      But I get no c:\temp\firmware.txt file
      I think the script is not executed

      Here is the command line viewed on the fog console:
      powershell.exe -ExecutionPolicy RemoteSigned -NoProfile -File boot-uefi.ps1

      I get this log

      ------------------------------------------------------------------------------
       31/03/2023 16:08:35 Client-Info Client Version: 0.11.19
       31/03/2023 16:08:35 Client-Info Client OS:      Windows
       31/03/2023 16:08:35 Client-Info Server Version: 1.5.8
       31/03/2023 16:08:35 Middleware::Response Success
       31/03/2023 16:08:35 SnapinClient Running snapin boot-uefi-pxe-first
       31/03/2023 16:08:35 Middleware::Communication Download: http://148.60.x.x//fog/service/snapins.file.php?mac=B8:85:84:AC:89:FA&taskid=5453
       31/03/2023 16:08:36 SnapinClient C:\Program Files (x86)\FOG\tmp\boot-uefi.ps1
       31/03/2023 16:08:36 Bus Emmiting message on channel: Notification
       31/03/2023 16:08:36 SnapinClient Starting snapin
       31/03/2023 16:08:40 SnapinClient Snapin finished
       31/03/2023 16:08:40 SnapinClient Return Code: 0
       31/03/2023 16:08:40 Bus Emmiting message on channel: Notification
       31/03/2023 16:08:40 Middleware::Communication URL: https://fogus/fog/service/snapins.checkin.php?taskid=5453&exitcode=0&mac=B8:85:84:AC:89:FA&newServ
      

      Any idea ?

      posted in Windows Problems
      L
      lebrun78
    • RE: Windows delete pxe boot after deploy

      I try to run the script as snapin
      But I get no c:\temp\firmware.txt file
      I think the script is not executed

      Here is the command line viewed on the fog console:
      powershell.exe -ExecutionPolicy RemoteSigned -NoProfile -File boot-uefi.ps1

      I get this log

      ------------------------------------------------------------------------------
       31/03/2023 16:08:35 Client-Info Client Version: 0.11.19
       31/03/2023 16:08:35 Client-Info Client OS:      Windows
       31/03/2023 16:08:35 Client-Info Server Version: 1.5.8
       31/03/2023 16:08:35 Middleware::Response Success
       31/03/2023 16:08:35 SnapinClient Running snapin boot-uefi-pxe-first
       31/03/2023 16:08:35 Middleware::Communication Download: http://148.60.x.x//fog/service/snapins.file.php?mac=B8:85:84:AC:89:FA&taskid=5453
       31/03/2023 16:08:36 SnapinClient C:\Program Files (x86)\FOG\tmp\boot-uefi.ps1
       31/03/2023 16:08:36 Bus Emmiting message on channel: Notification
       31/03/2023 16:08:36 SnapinClient Starting snapin
       31/03/2023 16:08:40 SnapinClient Snapin finished
       31/03/2023 16:08:40 SnapinClient Return Code: 0
       31/03/2023 16:08:40 Bus Emmiting message on channel: Notification
       31/03/2023 16:08:40 Middleware::Communication URL: https://fogus/fog/service/snapins.checkin.php?taskid=5453&exitcode=0&mac=B8:85:84:AC:89:FA&newServ
      

      Any idea ?

      posted in General Problems
      L
      lebrun78
    • RE: Windows delete pxe boot after deploy

      This powershell script is better:

      # Create text file containing firmware settings
      bcdedit /enum firmware > c:\temp\firmware.txt
      
      # Find the line containing "IPV4", and read the line just before that
      $FullLine = (( Get-Content c:\temp\firmware.txt | Select-String "IPV4" -Context 1 ).context.precontext)[0]
      
      # Delete our temporary file
      #del firmware.txt
      
      # Split line into fields using the first left-curly as the delimiter,
      # and then grab the second field (and restore the first left-curly)
      $GUID = '{' + $FullLine.split('{')[1]
      
      # Set the boot order
      #bcdedit /set {fwbootmgr} displayorder $GUID {bootmgr}
      cmd /c bcdedit /set "{fwbootmgr}" displayorder $GUID /addfirst
      
      posted in General Problems
      L
      lebrun78
    • RE: Windows delete pxe boot after deploy

      I found on this forum a solution:
      This powershel script works to set boot on pxe :

      This PowerShell script moves the first non windows entry to the top of the list.
      
      # This script looks for the first non-Windows Boot Manager entry in the UEFI/GPT boot order and moves it to the top
      # For preventing newly installed Windows from hijacking the top boot order spot on my UEFI/GPT image testing VMs
      # by mmseng
      # https://github.com/mmseng/bcdedit-revert-uefi-gpt-boot-order
      
      # Notes:
      # - There's very little point in using this on regular production machines being deployed. Its main use is for machines being repeatedly imaged, or might be useful for lab machines.
      # - AFAICT bcdedit provideds no way to pull the friendly names of the devices in the overall UEFI boot order list. Therefore, this script only moves the first entry it identifies in the list which is NOT "{bootmgr}" (a.k.a. "Windows Boot Manager"). It's up to the user to make sure the boot order will exist in a state where the desired result is achieved.
      # - In my case, my test UEFI VMs initially have the boot order of 1) "EFI Network", 2) whatever else. When Windows is installed with GPT partitioning, it changes the boot order to 1) "Windows Boot Manager", 2) "EFI Network", 3) whatever else. In that state, this script can be used to change the boot order to 1) "EFI Network", 2) "Windows Boot Manager", 3) whatever else.
      # - This functionality relies on the completely undocumented feature of bcdedit to modify the "{fwbootmgr}" GPT entry, which contains the overall list of UEFI boot devices.
      # - AFAICT bcdedit is really only designed to edit Windows' own "{bootmgr}" entry which represents one of the "boot devices" in the overall UEFI list.
      # - Here are some sources:
      #   - https://www.cnet.com/forums/discussions/bugged-bcdedit-349276/
      #   - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/bcd-system-store-settings-for-uefi
      #   - https://www.boyans.net/DownloadVisualBCD.html
      #   - https://serverfault.com/questions/813695/how-do-i-stop-windows-10-install-from-modifying-bios-boot-settings
      #   - https://serverfault.com/questions/714337/changing-uefi-boot-order-from-windows
      
      
      # Read current boot order
      echo "Reading current boot order..."
      $bcdOutput = cmd /c bcdedit /enum "{fwbootmgr}"
      echo $bcdOutput
      
      # Kill as many of the stupid characters as possible
      echo "Removing extraneous characters from boot order output..."
      $bcdOutput = $bcdOutput -replace '\s+',''
      $bcdOutput = $bcdOutput -replace '`t',''
      $bcdOutput = $bcdOutput -replace '`n',''
      $bcdOutput = $bcdOutput -replace '`r',''
      $bcdOutput = $bcdOutput.trim()
      $bcdOutput = $bcdOutput.trimEnd()
      $bcdOutput = $bcdOutput.trimStart()
      $bcdOutput = $bcdOutput -replace ' ',''
      echo $bcdOutput
      
      # Define a reliable regex to capture the UUIDs of non-Windows Boot Manager devices in the boot order list
      # This is difficult because apparently Powershell interprets regex is a fairly non-standard way (.NET regex flavor)
      # https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions
      # Even then, .NET regex testers I used didn't match the behavior of what I got out of various Powershell commands that accept regex strings
      # However this seems to work, even though I can't replicate the results in any regex testers
      $regex = [regex]'^{([\-a-z0-9]+)+}'
      echo "Defined regex as: $regex"
      
      # Save matches
      echo "Save strings matching regex..."
      $foundMatches = $bcdOutput -match $regex
      
      # Grab first match
      # If Windows Boot Manager (a.k.a. "{bootmgr}" was the first in the list, this should be the second
      # Which means it was probably the first before Windows hijacked the first spot
      # Which means it was probably my "EFI Network" boot device
      $secondBootEntry = $foundMatches[0]
      echo "First match: $secondBootEntry"
      
      # Move it to the first spot
      echo "Running this command:"
      echo "cmd /c bcdedit $bcdParams /set `"{fwbootmgr}`" displayorder $secondBootEntry /addfirst"
      cmd /c bcdedit $bcdParams /set "{fwbootmgr}" displayorder $secondBootEntry /addfirst
      
      posted in General Problems
      L
      lebrun78
    • Windows delete pxe boot after deploy

      Hello,
      In UEFI, Windows clears the PXE entry from the BIOS settings after a deployment.
      What method do you use to keep PXE in UEFI boot options?

      Arnaud

      posted in General Problems
      L
      lebrun78
    • 1
    • 2
    • 3
    • 4
    • 5
    • 15
    • 16
    • 1 / 16