• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. psyfer9983
    P
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 12
    • Best 1
    • Controversial 0
    • Groups 0

    psyfer9983

    @psyfer9983

    1
    Reputation
    489
    Profile views
    12
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    psyfer9983 Unfollow Follow

    Best posts made by psyfer9983

    • Windows Powershell script for DHCP config

      Thought I might share this for others who are using DHCP via Windows Server OS (2016+). The following script is what I’ve been using to quickly add all the entries and whatnot to have legacy and UEFI PXE options. Just copy/paste the code below and run it on the Windows server in question. It will ask for the DHCP server name (FQDN preferred), IP address of the scope you wish to modify and the IP address of the FOG server. May need to run it as admin and enable scripts on the OS.

      #Add-WindowsFeature -Name DHCP –IncludeManagementTools
      Import-Module DhcpServer
      cls
      "
      This script will add new vendor classes, policies and options
      66/67 for Legacy & UEFI PXE booting. Please double check what
      you enter in the prompts or you will need to rerun the script.
      This script will also update/replace entries that already
      exist so you can use it to change the IP of the FOG server.
      "
      $Server	= Read-Host -Prompt 'Enter the FULL name of the DHCP server (FQDN)'
      $Scope	= Read-Host -Prompt 'Enter the network scope IP address (DHCP server has the scope IP listed)'
      $WDSvr	= Read-Host -Prompt 'Enter the IP of the FOG server'
      
      $VendorClassUEFIx64 = @{
      	Name = "PXEClient UEFI (x64)"
      	Description = "PXEClient UEFI (x64)"
      	Type = "Vendor"
      	Data = "PXEClient:Arch:00007"
      	}
      
      $VendorClassUEFIx64_2 = @{
      	Name = "PXEClient UEFI (x64)_2"
      	Description = "PXEClient UEFI (x64)_2"
      	Type = "Vendor"
      	Data = "PXEClient:Arch:00008"
      	}
      
      $VendorClassUEFIx64_3 = @{
      	Name = "PXEClient UEFI (x64)_3"
      	Description = "PXEClient UEFI (x64)_3"
      	Type = "Vendor"
      	Data = "PXEClient:Arch:00009"
      	}	
      
      $VendorClassUEFIx86 = @{
      	Name = "PXEClient UEFI (x86)"
      	Description = "PXEClient UEFI (x86)"
      	Type = "Vendor"
      	Data = "PXEClient:Arch:00002"
      	}
      
      $VendorClassUEFIx86_2 = @{
      	Name = "PXEClient UEFI (x86)_2"
      	Description = "PXEClient UEFI (x86)_2"
      	Type = "Vendor"
      	Data = "PXEClient:Arch:00006"
      	}
      
      $VendorClassBIOS = @{
      	Name = "PXEClient BIOS (x86 & x64)"
      	Description = "PXEClient BIOS (x86 & x64)"
      	Type = "Vendor"
      	Data = "PXEClient:Arch:00000"
      	}
      
      Add-DhcpServerv4Class @VendorClassUEFIx64 -ComputerName $Server
      Add-DhcpServerv4Class @VendorClassUEFIx64_2 -ComputerName $Server
      Add-DhcpServerv4Class @VendorClassUEFIx64_3 -ComputerName $Server
      Add-DhcpServerv4Class @VendorClassUEFIx86 -ComputerName $Server
      Add-DhcpServerv4Class @VendorClassUEFIx86_2 -ComputerName $Server
      Add-DhcpServerv4Class @VendorClassBIOS -ComputerName $Server
      
      Add-DhcpServerv4Policy -Name "PXEClient UEFI (x64)" -ScopeId $Scope -Condition OR -VendorClass EQ,"PXEClient UEFI (x64)*"
      Add-DhcpServerv4Policy -Name "PXEClient UEFI (x86)" -ScopeId $Scope -Condition OR -VendorClass EQ,"PXEClient UEFI (x86)*"
      Add-DhcpServerv4Policy -Name "PXEClient BIOS" -ScopeId $Scope -Condition OR -VendorClass EQ,"PXEClient BIOS (x86 & x64)*"
      
      Set-DhcpServerv4OptionValue -OptionId 66 -Value $WDSvr -ComputerName $Server -ScopeId $Scope
      Set-DhcpServerv4OptionValue -OptionId 67 -Value "undionly.kpxe" -ComputerName $Server -ScopeId $Scope
      Set-DhcpServerv4OptionValue -OptionId 66 -Value $WDSvr -ComputerName $Server -ScopeId $Scope -PolicyName "PXEClient BIOS"
      Set-DhcpServerv4OptionValue -OptionId 67 -Value "undionly.kpxe" -ComputerName $Server -ScopeId $Scope -PolicyName "PXEClient BIOS"
      Set-DhcpServerv4OptionValue -OptionId 66 -Value $WDSvr -ComputerName $Server -ScopeId $Scope -PolicyName "PXEClient UEFI (x64)"
      Set-DhcpServerv4OptionValue -OptionId 67 -Value "ipxe.efi" -ComputerName $Server -ScopeId $Scope -PolicyName "PXEClient UEFI (x64)"
      Set-DhcpServerv4OptionValue -OptionId 66 -Value $WDSvr -ComputerName $Server -ScopeId $Scope -PolicyName "PXEClient UEFI (x86)"
      Set-DhcpServerv4OptionValue -OptionId 67 -Value "i386-efi/ipxe.efi" -ComputerName $Server -ScopeId $Scope -PolicyName "PXEClient UEFI (x86)"
      
      posted in Tutorials
      P
      psyfer9983

    Latest posts made by psyfer9983

    • Windows Powershell script for DHCP config

      Thought I might share this for others who are using DHCP via Windows Server OS (2016+). The following script is what I’ve been using to quickly add all the entries and whatnot to have legacy and UEFI PXE options. Just copy/paste the code below and run it on the Windows server in question. It will ask for the DHCP server name (FQDN preferred), IP address of the scope you wish to modify and the IP address of the FOG server. May need to run it as admin and enable scripts on the OS.

      #Add-WindowsFeature -Name DHCP –IncludeManagementTools
      Import-Module DhcpServer
      cls
      "
      This script will add new vendor classes, policies and options
      66/67 for Legacy & UEFI PXE booting. Please double check what
      you enter in the prompts or you will need to rerun the script.
      This script will also update/replace entries that already
      exist so you can use it to change the IP of the FOG server.
      "
      $Server	= Read-Host -Prompt 'Enter the FULL name of the DHCP server (FQDN)'
      $Scope	= Read-Host -Prompt 'Enter the network scope IP address (DHCP server has the scope IP listed)'
      $WDSvr	= Read-Host -Prompt 'Enter the IP of the FOG server'
      
      $VendorClassUEFIx64 = @{
      	Name = "PXEClient UEFI (x64)"
      	Description = "PXEClient UEFI (x64)"
      	Type = "Vendor"
      	Data = "PXEClient:Arch:00007"
      	}
      
      $VendorClassUEFIx64_2 = @{
      	Name = "PXEClient UEFI (x64)_2"
      	Description = "PXEClient UEFI (x64)_2"
      	Type = "Vendor"
      	Data = "PXEClient:Arch:00008"
      	}
      
      $VendorClassUEFIx64_3 = @{
      	Name = "PXEClient UEFI (x64)_3"
      	Description = "PXEClient UEFI (x64)_3"
      	Type = "Vendor"
      	Data = "PXEClient:Arch:00009"
      	}	
      
      $VendorClassUEFIx86 = @{
      	Name = "PXEClient UEFI (x86)"
      	Description = "PXEClient UEFI (x86)"
      	Type = "Vendor"
      	Data = "PXEClient:Arch:00002"
      	}
      
      $VendorClassUEFIx86_2 = @{
      	Name = "PXEClient UEFI (x86)_2"
      	Description = "PXEClient UEFI (x86)_2"
      	Type = "Vendor"
      	Data = "PXEClient:Arch:00006"
      	}
      
      $VendorClassBIOS = @{
      	Name = "PXEClient BIOS (x86 & x64)"
      	Description = "PXEClient BIOS (x86 & x64)"
      	Type = "Vendor"
      	Data = "PXEClient:Arch:00000"
      	}
      
      Add-DhcpServerv4Class @VendorClassUEFIx64 -ComputerName $Server
      Add-DhcpServerv4Class @VendorClassUEFIx64_2 -ComputerName $Server
      Add-DhcpServerv4Class @VendorClassUEFIx64_3 -ComputerName $Server
      Add-DhcpServerv4Class @VendorClassUEFIx86 -ComputerName $Server
      Add-DhcpServerv4Class @VendorClassUEFIx86_2 -ComputerName $Server
      Add-DhcpServerv4Class @VendorClassBIOS -ComputerName $Server
      
      Add-DhcpServerv4Policy -Name "PXEClient UEFI (x64)" -ScopeId $Scope -Condition OR -VendorClass EQ,"PXEClient UEFI (x64)*"
      Add-DhcpServerv4Policy -Name "PXEClient UEFI (x86)" -ScopeId $Scope -Condition OR -VendorClass EQ,"PXEClient UEFI (x86)*"
      Add-DhcpServerv4Policy -Name "PXEClient BIOS" -ScopeId $Scope -Condition OR -VendorClass EQ,"PXEClient BIOS (x86 & x64)*"
      
      Set-DhcpServerv4OptionValue -OptionId 66 -Value $WDSvr -ComputerName $Server -ScopeId $Scope
      Set-DhcpServerv4OptionValue -OptionId 67 -Value "undionly.kpxe" -ComputerName $Server -ScopeId $Scope
      Set-DhcpServerv4OptionValue -OptionId 66 -Value $WDSvr -ComputerName $Server -ScopeId $Scope -PolicyName "PXEClient BIOS"
      Set-DhcpServerv4OptionValue -OptionId 67 -Value "undionly.kpxe" -ComputerName $Server -ScopeId $Scope -PolicyName "PXEClient BIOS"
      Set-DhcpServerv4OptionValue -OptionId 66 -Value $WDSvr -ComputerName $Server -ScopeId $Scope -PolicyName "PXEClient UEFI (x64)"
      Set-DhcpServerv4OptionValue -OptionId 67 -Value "ipxe.efi" -ComputerName $Server -ScopeId $Scope -PolicyName "PXEClient UEFI (x64)"
      Set-DhcpServerv4OptionValue -OptionId 66 -Value $WDSvr -ComputerName $Server -ScopeId $Scope -PolicyName "PXEClient UEFI (x86)"
      Set-DhcpServerv4OptionValue -OptionId 67 -Value "i386-efi/ipxe.efi" -ComputerName $Server -ScopeId $Scope -PolicyName "PXEClient UEFI (x86)"
      
      posted in Tutorials
      P
      psyfer9983
    • RE: Option to edit Windows registry via FOG PXE boot?

      Been away for a while and haven’t had time to follow up with this. I have looked and looked and just can’t find how to do this. Is there any documentation for “reged”? How would one add a PXE menu option to add the following keys to the Windows registry WITHOUT booting into windows. The point of this is to remotely fix a machine that boot loops due to the wrong SATA mode set in the bios.

      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\iaStorV]
      "Start"=dword:00000000
      
      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\msahci]
      "Start"=dword:00000000
      
      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\pciide]
      "Start"=dword:00000000
      
      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\iaStor]
      "Start"=dword:00000000
      
      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\atapi]
      "Start"=dword:00000000
      

      I can’t update the BIOS directly (MB doesn’t support it). I’m trying to not go to the machine, I rather just go to the Fog server and tell it to run the reg fix remotely.

      posted in Feature Request
      P
      psyfer9983
    • RE: Option to edit Windows registry via FOG PXE boot?

      Thanks for the replies. The reason for the method is due to an image made for over 200 machines (thankfully all the same model) and not wanting to go to each machine, back them up, set bios setting, reimage and restore data. The machines all have good cmos batteries but a power flicker will sometimes cause them to revert to defaults like it has a post failure detection. Anyway, the image was made with AHCI mode and the default BIOS setting is RAID (stupid Dell). The SATA mode was set to AHCI mode in case some of them were to be upgraded to SSD as AHCI gives better compatibility/performance boost, we would just need to clone it and boot it. This site in question for me is a “site as is” problem that I’m sick of having to go to the machines just to change one setting in the BIOS to fix. Since I know what the default SATA mode is that’s being reverted too, I’ve been looking for a method of just changing the reg keys to reflect the settings but doing it remotely. It would save me having to physically go to the machines. I’ll check out the posted URLs and give them a try. My goal is to “fix” the image with the defaults for new installs and have the “reg patch” for the rest. The reg keys in question need to be changed to the following:

      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\msahci]
      "Start"=dword:00000000
      
      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\pciide]
      "Start"=dword:00000000
      
      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\iaStorV]
      "Start"=dword:00000000
      
      posted in Feature Request
      P
      psyfer9983
    • Option to edit Windows registry via FOG PXE boot?

      Would it be possible to edit the Windows registry via FOG PXE boot? I have machines that tend to reset the CMOS settings which causes endless boot loops due to the wrong SATA mode. Having the option to make changes to the registry with PXE would allow me to edit the keys to allow Windows to boot without touching the machine.

      posted in Feature Request
      P
      psyfer9983
    • RE: New PXE menu entry: Deploy Image & Shutdown

      @Tom-Elliott Thank you for trying. That field per each menu option would be great. As for now, we are setting Fog kernel with shutdown=1 when we need to mass deploy machines before sending them out to the sites and then remove the shutdown setting. Its a little hassle, but hey, it works. I’ll keep an eye out on newer releases to see if you manage to get the shutdown field put in.

      posted in Feature Request
      P
      psyfer9983
    • RE: New PXE menu entry: Deploy Image & Shutdown

      @Tom-Elliott said in New PXE menu entry: Deploy Image & Shutdown:

      http://fogipaddress/fog/service/ipxe/boot.php?mac

      This is what is currently in that PHP file, I don’t see the shutdown.

      #!ipxe
      set fog-ip X.X.X.X
      set fog-webroot fog
      set boot-url http://${fog-ip}/${fog-webroot}
      cpuid --ext 29 && set arch x86_64 || set arch i386
      iseq ${platform} efi && set key 0x1b || set key 0x1b
      iseq ${platform} efi && set keyName ESC || set keyName Escape
      prompt --key ${key} --timeout 3000 Booting... (Press ${keyName} to access the menu) && goto menuAccess || chain -ar ${boot-url}/service/ipxe/grub.exe --config-file="rootnoverify (hd0);chainloader +1"
      :menuAccess
      login
      params
      param mac0 ${net0/mac}
      param arch ${arch}
      param platform ${platform}
      param username ${username}
      param password ${password}
      param menuaccess 1
      param debug 1
      isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme
      isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme
      :bootme
      chain -ar http://X.X.X.X/fog/service/ipxe/boot.php##params
      
      posted in Feature Request
      P
      psyfer9983
    • RE: New PXE menu entry: Deploy Image & Shutdown

      Right now, the only way I can get the shutdown to work is by adding the “shutdown=1” to the “FOG_KERNEL_ARGS”. It works but its set globally which is not what I’m looking for. I would like everything to function like it should on default settings (unless set when creating a task in the WebUI). I would like to just add a new entry that does the same thing as “Deploy Image” but with a shutdown after deploy. If I could pass the “shutdown=1” to “FOG_KERNEL_ARGS” via new pxe menu entry, this would be great as it would leave everything else as default settings.

      FYI, I’m on version 1.3.3

      posted in Feature Request
      P
      psyfer9983
    • RE: New PXE menu entry: Deploy Image & Shutdown

      Does anyone know if or how to set “shutdown=1” via pxe menu?

      posted in Feature Request
      P
      psyfer9983
    • RE: New PXE menu entry: Deploy Image & Shutdown

      No, that wouldn’t work. Right now, I’m imaging 100 machines. The way we build our images is we install Windows, get it updated with drivers then we run a script before we upload the image to Fog. The script is just a host rename and domain join, something that Fog client can do but we can’t use it due to the company not wanting us to use it. If a shutdown after imaging can be done as a new menu entry, it would save me from having to register the machines in Fog and starting them from the web UI with the shutdown check box checked. I didn’t know if you could set up the menu entry to schedule a shutdown after the imaging like you can do from the web ui.

      posted in Feature Request
      P
      psyfer9983
    • New PXE menu entry: Deploy Image & Shutdown

      I would love to see an option to deploy an image then shutdown right on the PXE menu. It would save me from registering the machine and scheduling a deploy image with the shutdown check box checked. Anyway of doing this now via “iPXE New Menu Entry” in FOG?

      posted in Feature Request
      P
      psyfer9983