• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. Jamaal
    J
    • Profile
    • Following 1
    • Followers 0
    • Topics 13
    • Posts 78
    • Best 8
    • Controversial 0
    • Groups 0

    Jamaal

    @Jamaal

    10
    Reputation
    618
    Profile views
    78
    Posts
    0
    Followers
    1
    Following
    Joined Last Online
    Age 45

    Jamaal Unfollow Follow

    Best posts made by Jamaal

    • RE: Need help to understand host.class.php

      @jamaal said in Need help to understand host.class.php:

      Hello all,

      I’m banging my head to understand the host.class.php file.
      I have a few posts based on Powershell to add the “location” field for a computer to be created for example.

      host.PNG

      I already have the locations plug in installed and it works fine in the gui, but when I run the powershell script, location doesn’t show in Powershell, but in the gui.

      I’m not trying to image yet, but I want to be able to add on a custom website; ex; Jira ticket system, the host location. It should match up in the “location” field in Powershelll.

      I saw a post you can edit the host.class.php file.

      I did and here’s a screen shot:
      host php.PNG

      I went to create a host and it doesn’t show up, not sure what I’m doing wrong.

      Here’s when I went to see if the host got created when attempting to add it via the gui. I forgot to get the words before it, but it says hosts not found.
      attempt 2.PNG

      If I can get some guidance to what I’m donig wrong, I appreciate it.

      Here’s my version of FOG:
      version.PNG

      All,

      This can be resolved. I finally was able to add location via Powershell! I didn’t even need to mess with the host.class file in FOG. This is thanks too @JJ-Fullmer . He had a reference to a post he had about Powershell and FOG via adding groups:

      https://forums.fogproject.org/topic/12026/powershell-api-module/15?_=1648864559519

      So I ended up adding another variable called $newassocias2

      resolution.PNG

      Again thanks to everyone that contributes to this page. I’m happy & grateful to using this product.

      posted in FOG Problems
      J
      Jamaal
    • RE: fog API powershell help

      Ok, I think I got this figured out just now.
      Thanks to you jj, I followed your example from your original link:

      https://forums.fogproject.org/topic/12026/powershell-api-module/11

      So far I got this to work on one host: Here’s what I did by using your script:

      $newAssocs = New-Object System.Collections.Generic.List[object];
      $computer = (get-foghost -hostname “itloaner”).id
      $groups = (get-fogobject -type object -coreobject group).groups | where-object name -eq “sales”
      $groupAssocs = Get-FogObject -Type Object -CoreObject groupassociation

      $json = @{
      “hostID”=$computer;
      “groupID”=“$($groups.id)”;
      } | ConvertTo-Json;
      # Note, when creating the json splat and then piping it to convertto-json you must encapsulate properties and values in quotes and match the case of the original property (i.e. ID instead of Id) as in this example or it won’t parse right and will return a 417 error from the api

      $result = New-FogObject -type object -coreObject groupassociation -jsonData $json;
      $NewAssocs.Add($result);

      #list the newassocs that added the laptops to your group
      $NewAssocs;

      It then showed up as it added as per the results attached in this message.test1.PNG

      For further proof, I went to my test host and verified it was added via the new-fogobject command. I’m starting to understand now how this works. I just need to keep playing around with it and should be good going forward.

      My next task is to try to create a task via powershell to get the inventory of the machine before deploying the image. If you know of any commands, please let me know and I’ll keep trying myself as well.

      Again thanks for the info.

      posted in General
      J
      Jamaal
    • RE: Help with Win10 Driver injection

      @george1421 hey George, so I see what the problem was with WSUS. I thought the content folder can be put anywhere since it said remote path. I tried my NAS both network path and iscsi, but still locks up the downloads. I did research and said it’s not supported in a network share, so I put it back on the local.

      Now for the Office 2013 updates, I found this online to extract the service pack 1 and I was able to get the updates faster compared to WSUS.

      https://www.howto-outlook.com/howto/slipstreamoffice2013sp.htm

      I’m working on the unattend file and will work on copying files this weekend. The offline script I was following sucked and didn’t work no matter what I tried. I’ll keep you posted. Thanks for leading me in the right direction.

      posted in General Problems
      J
      Jamaal
    • RE: unable to install CA certificate (MDT 2013)

      @Sebastian-Roth said in unable to install CA certificate (MDT 2013):

      @Jamaal said in unable to install CA certificate (MDT 2013):

      I changed from the quiet switch to passive and I noticed the CA certificate error.

      Please give us more information about this. Exact error message? Possible take a screenshot and port here.

      Please close this ticket! It was my mistake. The issue was that I found a powershell script to disable the internet access during the MDT process, but the program was since fog tried to reach the ip address of the fog server, it was being blocked due to non internet access. I moved the script further down the process and it installed. Thanks for all of your input though.

      posted in FOG Problems
      J
      Jamaal
    • RE: Powershell API Module

      @jj-fullmer

      Hello, jj,

      Thanks for the fog api notes, appreciate you helping us out. I’m not sure if you remembered me, but have a few questions.

      I’m trying to do 2 things. One to assign a group to a machine one created in fog via powershell. I tried get-foggroupbyname, but says the parameter is not recognized.parameter not recognized.PNG

      It then told me to go to c:\program files… until I got to fogapi.psm1

      I copied and pasted the command for cmdletBinding.

      It didn’t error out, but didn’t return anything. Ex; , I know I created a Sales group in the Fog Gui with snapins assigned to it, so I wanted the machine to be assigned to that group to make it more dynamic. Please see attached pics. I’ll keep trying as well on my side. I’m so so on Powershell, but came a long way.parameter 2.PNG

      posted in Tutorials
      J
      Jamaal
    • RE: fog API powershell help

      @jj-fullmer said in fog API powershell help:

      $snapinsToRemove = @(‘snapin’,‘names’,‘here’);

      That’s what I needed, an array to choose from a list. Thank you so much! Really appreciate you on helping me on this.

      posted in General
      J
      Jamaal
    • RE: FOG 1.5.4 API host module settings

      @Sebastian-Roth said in FOG 1.5.4 API host module settings:

      Pinging @JJ-Fullmer on this. 🙂

      All,

      I figured this out! I got hostname changer via PowerShell. So here’s what I did to resolve it.
      So with the script I got from this forum last week, I know it had the Json in a splat format. I’m so so with PowerShell
      and doing a lot better than a few years back. So basically what KaterKarlo said, he has moduleid = 9.

      It wasn’t working for me. To get the correct name and ID number, I ended up going to my fog server via the browser, then right click on the browser and view page source did a search for hostname changer. Then it came up the name modules and the value of 9. I finally ended up putting it with the rest of the splat and joined it with no issues:

      “modules” = 9

      I hope this helps someone as well if they need to get the values of a host.
      But thank you guys always for pointing me in the right direction.

      posted in FOG Problems
      J
      Jamaal
    • RE: Powershell API Module

      @jj-fullmer said in Powershell API Module:

      vscode

      Thanks jj,

      I’ll install & try out.

      posted in Tutorials
      J
      Jamaal

    Latest posts made by Jamaal

    • RE: FOG API question

      Ok,

      I finally figured this out. I know it’s not the best method, but I prefer this than having the wording “plain text” Here’s what I did in case someone needs to do the same.

      I read that API tokens do not go well as a securestring. Here are some references:
      https://jamesone111.wordpress.com/2020/04/10/transformers-for-powershell-parameters-which-take-secrets/, and https://github.com/Azure/azure-powershell/issues/25533.

      So in order to get past this, I needed to create another variable as show below:

      • $testapi1 = [pscredential]::new(“token”,$yourtoken)

      You’re basically adding the pscredential above like you’re going to setup a username, but you put something like “token” or any wording as a placeholder for the username, then put the token in.

      • Then after you define the header you do something like this: $testheader.add(fog-user-token’,$testapi1.GetNetworkCredential().password)

      Again it’s not the best method, but I also read a way when you do read-host -aseecurestring and save your api there as a variable, you can dispose that variable so it doesn’t stay in memory.

      $test.disposeof

      If someone has any better ideas, please let me know as I’m always on here learning new things and want to share as well. This basically can be closed out.

      posted in FOG Problems
      J
      Jamaal
    • FOG API question

      Hello @JJ-Fullmer , hope all is well.
      First of all, thanks for creating that Powershell module for FOG to be used via Powershell.
      I have a question in regards to the script I’ve been using for a while. In it has the API for both the user and the FOG server.

      I want to be more secure in the sense of not putting the API in the script. I tried Microsoft’s module Secret Management and I can store both api keys under 2 different secrets. Here is the link from Microsoft: https://learn.microsoft.com/en-us/powershell/utility-modules/secretmanagement/get-started/using-secretstore?view=ps-modules

      But when I try to retrieve the secrets, I get the 403 forbidden message.

      Powershell variables for the both api keys for example: f8dcc28c-aef3-45c7-a765-1719c30df353-image.png

      Error message: 3cce1c57-e18b-4b3b-965b-aed75980c21c-image.png

      It will only work if I add -asplaintext for example:

      94f64f07-9835-4fac-8265-cda63d9de679-image.png

      It won’t take the System.Security.SecureString

      I double checked to make sure I’m using the correct fog and user api keys, but no dice.
      Is there a way to secure these API keys instead of putting them directly in the Powershell script and also not doing the command -asplaintext?

      If anyone has suggestions, please let me know.

      posted in FOG Problems
      J
      Jamaal
    • RE: Dell Latitude 5530 issue

      @george1421

      Ok, let me try some things this week and let you guys know. Thanks guys.

      posted in Windows Problems
      J
      Jamaal
    • Dell Latitude 5530 issue

      Hello, all,

      I haven’t posted in a while because I haven’t had any issues for a long time. So there it goes.
      We recently started purchasing Dell Latitude 5530 laptops I have an issue with them for some reason.
      First off, the version of FOG I have is 1.5.9 now, had 1.5.10 and went back down because I thought this was causing the issue.

      The problem is that FOG images the laptop fine, but when it restarts to boot into Windows and continue the step “getting devices ready”, it goes right
      to the ctrl alt delete screen and then the administrator password is not working. This is very weird.

      Before I downgraded back to 1.5.9, I reimaged a Lenovo T510 laptop (yes it’s a dinosaur, lol) to rule out anything with setupcomplete.cmd, imaged with no issues.

      I have FOG running on Ubuntu 20.04.6 on Windows Hyper-v, 2019.

      I deleted the network drivers from the Latitude 5530 folder numerous times and still after it images, the network at the ctrl alt delete is not working.
      No wireless nor network card, can’t even log onto the laptop.

      I know I have the pnp command in the setupcomplete.cmd and it works fine on Lenovo laptops, but for some reason from since yesterday, I started to run into issues.
      I looked in the forum before posting this, but can’t find any solution. If someone can give me an idea why this is happening, I appreciate it.

      posted in Windows Problems
      J
      Jamaal
    • RE: HyperV Gen1 Hangs on iPXE Initializing Devices

      @Gerrit-Anderson Thank you for this! I was battling this yesterday and this fixed the issue immediately.

      posted in Tutorials
      J
      Jamaal
    • RE: Powershell and fog

      @sebastian-roth said in Powershell and fog:

      @Jamaal Anything in the Apache error logs? Sure the API is enabled (user and global)?

      Yes, the API is enabled. I’m not sure on how to check the apache error logs.

      posted in Tutorials
      J
      Jamaal
    • RE: Powershell and fog

      @tom-elliott said in Powershell and fog:

      @jamaal What if you define fogsrv to the IP address of the fogserver?

      FQDN must be reachable by the device in question. Using the IP address is usually a more sure bet.

      I’m going to try that later & let you know. Thanks for the suggestion, Tom.

      posted in Tutorials
      J
      Jamaal
    • RE: Powershell and fog

      @tom-elliott said in Powershell and fog:

      @jamaal is fogsrv the actual fqdn of your fogserver?

      Yes, just for testing purposes. Eventually I will have a different name.

      posted in Tutorials
      J
      Jamaal
    • Powershell and fog

      Re: Powershell API Module

      Hello jj,

      I hope all is well with you. I am having fun with Powershell and the machine deployment. I
      have one question. So I’m having a little hard time with one thing. I would like to have Powershell create an image name in the images section in FOG. Now I can go in the console manually and create an image name for example Windows 10 22h2, but how would I go about creating it automatically in Powershell if it doesn’t exit?

      I tried new-fogobject -type object -coreobject image -jsondata $hostimage -verbose and got the 417 error. I had the json like this:

      VERBOSE: Building uri and api call
      VERBOSE: Pulling settings from settings file
      VERBOSE: Pulling settings from settings file
      VERBOSE: Building Headers…
      VERBOSE: Building api call URI…
      VERBOSE: POSTing System.Collections.Hashtable to/from http://fogsrv/fog/image/create
      VERBOSE: POST http://fogsrv/fog/image/create with -1-byte payload
      VERBOSE: POST http://fogsrv/fog/image/create with -1-byte payload
      Invoke-WebRequest : The remote server returned an error: (417) Expectation Failed.
      At C:\Program Files\WindowsPowerShell\Modules\FogApi\2103.2.12\FogApi.psm1:780 char:23

      •         $result = Invoke-WebRequest @apiCall;
        
      •                   ~~~~~~~~~~~~~~~~~~~~~~~~~~
        
        • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebR
          equest], WebException
        • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequ
          estCommand

      VERBOSE: finished api call

      I can’t do new-item because Powershell says it can’t find the path to the URL which I understand in that case you can’t use new-item, not like you’re creating a folder or file in the Windows operating system. I’ll keep trying, but that would be a good feature instead of creating it in the console. I’m trying to make the script more dynamic if something doesn’t exist in the console.

      Again, thanks to you and the other person (forgot his screen name) that helped with Powershell and FOG, makes a huge difference!

      posted in Tutorials
      J
      Jamaal
    • RE: Need help to understand host.class.php

      @jamaal said in Need help to understand host.class.php:

      Hello all,

      I’m banging my head to understand the host.class.php file.
      I have a few posts based on Powershell to add the “location” field for a computer to be created for example.

      host.PNG

      I already have the locations plug in installed and it works fine in the gui, but when I run the powershell script, location doesn’t show in Powershell, but in the gui.

      I’m not trying to image yet, but I want to be able to add on a custom website; ex; Jira ticket system, the host location. It should match up in the “location” field in Powershelll.

      I saw a post you can edit the host.class.php file.

      I did and here’s a screen shot:
      host php.PNG

      I went to create a host and it doesn’t show up, not sure what I’m doing wrong.

      Here’s when I went to see if the host got created when attempting to add it via the gui. I forgot to get the words before it, but it says hosts not found.
      attempt 2.PNG

      If I can get some guidance to what I’m donig wrong, I appreciate it.

      Here’s my version of FOG:
      version.PNG

      All,

      This can be resolved. I finally was able to add location via Powershell! I didn’t even need to mess with the host.class file in FOG. This is thanks too @JJ-Fullmer . He had a reference to a post he had about Powershell and FOG via adding groups:

      https://forums.fogproject.org/topic/12026/powershell-api-module/15?_=1648864559519

      So I ended up adding another variable called $newassocias2

      resolution.PNG

      Again thanks to everyone that contributes to this page. I’m happy & grateful to using this product.

      posted in FOG Problems
      J
      Jamaal