• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. admiralshaw
    A
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 3
    • Best 1
    • Controversial 0
    • Groups 0

    admiralshaw

    @admiralshaw

    1
    Reputation
    1
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    admiralshaw Unfollow Follow

    Best posts made by admiralshaw

    • RE: "Deploy Image" Not Working for HP Probook 450 G9

      @LLamaPie @JJ-Fullmer @Sebastian-Roth Thank you all for the suggestions and pointing me to the other thread as well.

      I wanted to confirm that disabling wifi in the BIOS does work and what was happening was that I used LLamaPie’s method of looking up the host in the web interface and doing a deploy from there because I was “being thorough” (read uptight) about the registration of the brand new computers. Then when I handed it off to my technicians they were using the faster deploy from PXE. Thank you all for the help!

      HP does not have a way to disable wifi UEFI stack vs ethernet stack which has been a feature on previous models, so maybe they’ll have a BIOS update.

      posted in FOG Problems
      A
      admiralshaw

    Latest posts made by admiralshaw

    • RE: HP EliteBook 840 G9 - Cannot deploy image

      As for the Windows computers that need an external ethernet adaptor, I took a powershell script the FOG team made and added some lines to lookup the HP computer by serial and update the primary MAC to the HP MAC instead of the adaptor to avoid the “computer already exists” problems. When this is working, I leave the computer on the same adaptor until it’s all imaged and joined to my AD domain before moving the adaptor to another computer to start another image, at which point the script should have fixed the MAC address in the FOG database.

      I believe you have to install the FOG powershell API in the base image, and then have this powershell script run after sysprep. I use the Setupcomplete.cmd method by putting a cmd file in %WINDIR%\Setup\Scripts. On an HP, I make sure and have the MAC Address Manager app installed and the service is running before the API script runs.

      NOTE I have not used this method since FOG 1.5.6. I’m trying to get my servers updated with 1.5.10.

      Setupcomplete.cmd:

      Start "Starting HP Services" /wait /separate /realtime CMD /C c:\windows\system32\sysprep\services.cmd
      Start "Updating MAC Address" /wait /separate /realtime CMD /C powershell -executionpolicy bypass -file c:\windows\system32\sysprep\macupdate.ps1
      exit
      

      services.cmd

      for /F "tokens=3 delims=: " %%H in ('sc query "HPMAMSrv" ^| findstr "        STATE"') do (
      
        if /I "%%H" NEQ "RUNNING" (
         net start "HPMAMSrv"
         timeout /nobreak 3
        )
      )
      

      macupdate.ps1

      <#
      	This script updates the primary MAC address in the FOG database POST sysprep. This is for computers that use the Host-Based-MAC-Address
      	feature to overwrite the MAC address of an attached ethernet dongle (ie the HP x360 which does not have an integrated NIC.)
      	
      	Invoke-FogApi written by the FOG development team. Updated 9-26-2017.
      #>
      
      function Invoke-FogApi {
          <#
              .SYNOPSIS
                 a cmdlet function for making fogAPI calls via powershell
              
              .DESCRIPTION
                  takes a few parameters with a default that will get all hosts
                  Makes a call to the api of a fog server and returns the results of the call
                  The returned value is an object that can then be easily filtered, processed, and otherwise manipulated in poweshell.
                  i.e. you could take the return value of the default all hosts and run 
                      $(invoke-fogapi).hosts | where name -match "$(hostname)"
                  to get the host information for the current computer
              
              .PARAMETER fogApiToken
                  a string of your fogApiToken gotten from the fog web ui. Can be set in the function as a default or passed to the function
              
              .PARAMETER fogUserToken
                 a string of your fog user token gotten from the fog web ui in the user section. Can be set in the function as a default or passed to the function
              
              .PARAMETER fogServer
                  The hostname or ip address of your fogserver, defaults to the default fog-server
              
              .PARAMETER uriPath
                  Put in the path of the apicall that would follow http://fog-server/fog/
                  i.e. 'host/1234' would access the host with an id of 1234
                  
              .PARAMETER Method
                Defaults to 'Get' can also be 
              
              .PARAMETER jsonData
                  The jsondata string for including data in the body of a request
              
              .EXAMPLE
                  #if you had the api tokens set as default values and wanted to get all hosts and info you could run this, assuming your fogserver is accessible on http://fog-server
                  Invoke-FogApi;
      
              .Example
                  #if your fogserver was named rawr and you wanted to put rename host 123 to meow
                  Invoke-FogApi -fogServer "rawr" -uriPath "host/123" -Method "Put" -jsonData "{ `"name`": meow }";
      
              .Link
                  https://news.fogproject.org/simplified-api-documentation/
              
              .NOTES
                  The online version of this help takes you to the fog project api help page
                  
          #>
      
          [CmdletBinding()]
          param (
            #took out my api tokens, you can default apitoken strings here or pass them to the function
              [string]$fogApiToken = 'token...', 
              [string]$fogUserToken = 'token...',
              [string]$fogServer = "x.x.x.x",
              [string]$uriPath = "host", #default to get all hosts
              [string]$Method = "Get",
              [string]$jsonData #default to empty
          )
          
          begin {
              # Create headers
              Write-Verbose "Building Headers...";
              $headers = @{};
              $headers.Add('fog-api-token', $fogApiToken);
              $headers.Add('fog-user-token', $fogUserToken);
      
              # Set the baseUri
              Write-Verbose "Building api call URI...";
              $baseUri = "http://$fogServer/fog";
              $uri = "$baseUri/$uriPath";
          }
          
          process {
      
              Write-Verbose "$Method`ing $jsonData to/from $uri";
              if ($Method -eq "Get") { #don't include body with get
                  $result = Invoke-RestMethod -Uri $uri -Method $Method -Headers $headers -ContentType "application/json";            
              }
              else {
                  $result = Invoke-RestMethod -Uri $uri -Method $Method -Headers $headers -Body $jsonData -ContentType "application/json";
              }
          }
          
          end {
              Write-Verbose "finished api call";
      		return $result;
          }
      }
      
      # Get MAC addresses of local ethernet adapters, should return only the live (plugged into switch and lit) ethernet MAC.
      # Will fail if no live adapters found or more than one found. Should ignore WiFi.
      
      $colItems = get-netadapter | where {$_.name -like "ethernet*" -and $_.status -match "up"} | select -expandproperty macaddress
      $c = 0;
      	foreach ($objItem in $colItems) {  
      		$c++;
      		$hostMAC = $objItem;
          }
      if ($c -ne 1) {exit;}
      
      # Remove dashes from get-netadapter for simple match later. Replace the dashes in the MAC with colons, and make lower case for FOG format.
      $hostMACsimple = $hostMAC -replace '-','';
      $hostMAC = $hostMAC.ToLower() -replace '-',':';
      
      # Grab the computer serial number from the BIOS, really only works on brand name computers.
      $theserial = gwmi win32_bios | select -expandproperty serialnumber
      if ($theserial -eq $null) {exit;}
      
      # Find the database host id number on the FOG server.
      $hostId = ((Invoke-FogApi -uriPath "inventory").inventorys | Where-Object sysserial -match "$theserial").hostID;
      if ($hostId -eq $null) {exit;}
      
      # With the host id get the primary mac association that matches that host id.
      $primacitem = (Invoke-FogApi -uriPath "macaddressassociation").macaddressassociations | Where-Object {$_.hostID -match "$hostId" -and $_.primary -eq 1};
      $primac = ((Invoke-FogApi -uriPath "macaddressassociation").macaddressassociations | Where-Object {$_.hostID -match "$hostId" -and $_.primary -eq 1}).mac;
      if ($primac -eq $null) {exit;}
      $primac = $primac -replace ':','';
      
      # If the MACs are different, update the fog database
      if ($hostMACsimple -match $primac) {exit;} else {
      $primacitem.mac = $hostMAC;
      Invoke-FogApi -jsonData ($primacitem | ConvertTo-Json) -Method "Put" -uriPath "macaddressassociation/$($primacitem.id)/edit";
      }
      
      posted in Hardware Compatibility
      A
      admiralshaw
    • RE: "Deploy Image" Not Working for HP Probook 450 G9

      @LLamaPie @JJ-Fullmer @Sebastian-Roth Thank you all for the suggestions and pointing me to the other thread as well.

      I wanted to confirm that disabling wifi in the BIOS does work and what was happening was that I used LLamaPie’s method of looking up the host in the web interface and doing a deploy from there because I was “being thorough” (read uptight) about the registration of the brand new computers. Then when I handed it off to my technicians they were using the faster deploy from PXE. Thank you all for the help!

      HP does not have a way to disable wifi UEFI stack vs ethernet stack which has been a feature on previous models, so maybe they’ll have a BIOS update.

      posted in FOG Problems
      A
      admiralshaw
    • RE: "Deploy Image" Not Working for HP Probook 450 G9

      Same thing is going on for me. It’s not completely a hardware issue. I was able to deploy around a dozen of these computers, then it started doing this exact behavior where it asks for the password over and over then I end up on whatever the last menu item is for me.

      In my case, the last menu item was the “Client System Information (Compatibility)”. Turning my menu options on and off, I can confirm that whatever the last menu item is will be the thing that launches instead of “Deploy Image”. If the last menu item is Deploy Image, it just starts over again as if I fresh PXE booted it.

      This seems to have started after I did a yum update on the server on 4/20. Blast my chill update day! I did not backup first because I’m an idiot. Anyway, if it is an update that killed my ability to deploy on newer computers, and we can figure it out… I’m tearing out what little hair I have left with 50 new computers left to go 😞

      posted in FOG Problems
      A
      admiralshaw