Navigation

    FOG Project

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

    Jamaal

    @Jamaal

    9
    Reputation
    69
    Posts
    617
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online
    Age 42

    Jamaal 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: 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
    • 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

      posted in FOG Problems
      J
      Jamaal
    • RE: Fog Location help via FOG API

      @jamaal said in Fog Location help via FOG API:

      @jamaal said in Fog Location help via FOG API:

      Hello, all

      I’m starting to get closer, but not sure what I’m missing. I read up on pscustomobject and I did the following in the script. So in the first screen shot, I got the member properties from get-foghost -hostname $machinename | get-member

      The screenshot called “before”, doesn’t have the location field.

      before.PNG

      What I did was created a pscustomobject by creating a variable called $member

      so $member = new-object -typename psobject
      The screenshot I did later was called “after”
      after.PNG

      I then did $member | get-member and it added location as you can see in the screen shot.
      In the parameter, I did location = Westbury for example. Here’s some screen shots of my script.

      parameters.PNG

      code that I used to add location:
      location.PNG

      So I already have the plugin Location installed with values such as Woodbury and Edison.

      I’m trying to get Powershell to just load my section from $location to location as seen below, but it’s not working despite I used the pscustomobject
      accomplish.PNG

      I also tried adding location under $hostjson to see if this helps before as well.
      hostjson.PNG

      Ok,

      This is resolved now. Here are the steps I did to fix this in case someone else needs this in their Powershell script.

      You need to go the Powershell module file in C:\Program Files\WindowsPowerShell\Modules\FogApi\2103.2.12

      Once in there, open up the FogApi.psm1 file and look for the line that says $coreObjects = @(

      add this to the line in alphabetical order:

      “location” and save the file.

      Once you did that, go to powershell and type in:

      Get-FogObject -type object -coreObject location

      If done right, you’ll see the location correspond to the location plug in you installed.
      location.PNG

      and after:

      location2.PNG

      You don’t need to mess with the pscustomobject because when you install the plugin and edit the psm1 file, it will do it automatically for you.

      pscustomobject location.PNG

      This can be closed. I’ll create a tutorial on the exact steps because you need to create storage nodes if you have multiple sites in mind.

      posted in FOG Problems
      J
      Jamaal
    • RE: Fog Location help via FOG API

      @jamaal said in Fog Location help via FOG API:

      Hello, all

      I’m starting to get closer, but not sure what I’m missing. I read up on pscustomobject and I did the following in the script. So in the first screen shot, I got the member properties from get-foghost -hostname $machinename | get-member

      The screenshot called “before”, doesn’t have the location field.

      before.PNG

      What I did was created a pscustomobject by creating a variable called $member

      so $member = new-object -typename psobject
      The screenshot I did later was called “after”
      after.PNG

      I then did $member | get-member and it added location as you can see in the screen shot.
      In the parameter, I did location = Westbury for example. Here’s some screen shots of my script.

      parameters.PNG

      code that I used to add location:
      location.PNG

      So I already have the plugin Location installed with values such as Woodbury and Edison.

      I’m trying to get Powershell to just load my section from $location to location as seen below, but it’s not working despite I used the pscustomobject
      accomplish.PNG

      I also tried adding location under $hostjson to see if this helps before as well.
      hostjson.PNG

      posted in FOG Problems
      J
      Jamaal
    • Fog Location help via FOG API

      Hello, all

      I’m starting to get closer, but not sure what I’m missing. I read up on pscustomobject and I did the following in the script. So in the first screen shot, I got the member properties from get-foghost -hostname $machinename | get-member

      The screenshot called “before”, doesn’t have the location field.

      before.PNG

      What I did was created a pscustomobject by creating a variable called $member

      so $member = new-object -typename psobject
      The screenshot I did later was called “after”
      after.PNG

      I then did $member | get-member and it added location as you can see in the screen shot.
      In the parameter, I did location = Westbury for example. Here’s some screen shots of my script.

      parameters.PNG

      code that I used to add location:
      location.PNG

      So I already have the plugin Location installed with values such as Woodbury and Edison.

      I’m trying to get Powershell to just load my section from $location to location as seen below, but it’s not working despite I used the pscustomobject
      accomplish.PNG

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

      @sebastian-roth said in FOG API help:

      @jamaal said in FOG API help:

      Cannot convert value “http://your fog server hostname or ip address to be used for created the url used in api calls default is fog-server or fogServer/fog/task/active”

      I have not used @JJ-Fullmer’s FogApi yet I have to admit. But this message seems to stem from the settings.json not being setup correctly: https://github.com/darksidemilk/FogApi/blob/master/FogApi/lib/settings.json

      I’ll definitely check this out today, thanks Sebastian. One more question. How would I add location via api? We have our main site and also have another location and I wanted the techs to select Boston as a site for example. I do have the plug in enabled via the console, but want to do it in the Powershell script if possible.

      posted in General
      J
      Jamaal
    • FOG API help

      Hello all,

      I haven’t posted in a while, so I need a little help.
      I’m running Server 2019 Data Center on my test desktop machine and have FOG API installed. The script runs great by itself, ex; adding the machine name and snapins based on parameters, but here’s the issue.

      I’m testing out a third party software called Au2mator. It can use an engine like Powershell. I have the questions in parameters and when it runs, it creates the task and machine name in Powershell, but doesn’t add the machine to the group or does it add the snapins. I have the Au2mator software using a service account that has local AD rights on the box, the pool has the correct service account and password, but still get these errors when I run it with the Au2mator software:

      Log Name: PowerShellCore/Operational
      Source: PowerShellCore
      Date: 2/3/2022 6:16:31 AM
      Event ID: 4100
      Task Category: Executing Pipeline
      Level: Warning
      Keywords: None
      User: JBCORP\Au2umator
      Computer: HYPER-SRV.jbcorp.com
      Description:
      Error Message = Cannot bind parameter ‘Uri’. Cannot convert value “http://your fog server hostname or ip address to be used for created the url used in api calls default is fog-server or fogServer/fog/task/active” to type “System.Uri”. Error: “Invalid URI: The hostname could not be parsed.”
      Fully Qualified Error ID = CannotConvertArgumentNoMessage,Invoke-FogApi

      Context:
      Severity = Warning
      Host Name = Default Host
      Host Version = 7.1.3
      Host ID = ad4c57c0-2fac-4d68-a7c0-d9af957dc1a0
      Host Application = C:\Inetpub\au2mator\A2M.Presentation.dll
      Engine Version = 7.1.3
      Runspace ID = 4e8439ad-a4ba-4dc0-adeb-519501e60f21
      Pipeline ID = 1
      Command Name = Invoke-FogApi
      Command Type = Function
      Script Name = C:\Program Files\WindowsPowerShell\Modules\FogApi\2103.2.12\FogApi.psm1
      Command Path =
      Sequence Number = 31
      User = testdomain\testaccount
      Connected User =
      Shell ID = Microsoft.PowerShell

      User Data:

      Event Xml:
      <Event xmlns=“http://schemas.microsoft.com/win/2004/08/events/event”>
      <System>
      <Provider Name=“PowerShellCore” Guid="{f90714a8-5509-434a-bf6d-b1624c8a19a2}" />
      <EventID>4100</EventID>
      <Version>1</Version>
      <Level>3</Level>
      <Task>106</Task>
      <Opcode>19</Opcode>
      <Keywords>0x0</Keywords>
      <TimeCreated SystemTime=“2022-02-03T11:16:31.401253300Z” />
      <EventRecordID>1654</EventRecordID>
      <Correlation ActivityID="{b5238339-183a-0002-0598-30b53a18d801}" />
      <Execution ProcessID=“12736” ThreadID=“14664” />
      <Channel>PowerShellCore/Operational</Channel>
      <Computer>HYPER-SRV.jbcorp.com</Computer>
      <Security UserID=“S-1-5-21-3280824798-2153847428-653206688-5347” />
      </System>
      <EventData>
      <Data Name=“ContextInfo”> Severity = Warning
      Host Name = Default Host
      Host Version = 7.1.3
      Host ID = ad4c57c0-2fac-4d68-a7c0-d9af957dc1a0
      Host Application = C:\Inetpub\au2mator\A2M.Presentation.dll
      Engine Version = 7.1.3
      Runspace ID = 4e8439ad-a4ba-4dc0-adeb-519501e60f21
      Pipeline ID = 1
      Command Name = Invoke-FogApi
      Command Type = Function
      Script Name = C:\Program Files\WindowsPowerShell\Modules\FogApi\2103.2.12\FogApi.psm1
      Command Path =
      Sequence Number = 31
      User = JBCORP\au2umator
      Connected User =
      Shell ID = Microsoft.PowerShell
      </Data>
      <Data Name=“UserData”>
      </Data>
      <Data Name=“Payload”>Error Message = Cannot bind parameter ‘Uri’. Cannot convert value “http://your fog server hostname or ip address to be used for created the url used in api calls default is fog-server or fogServer/fog/task/active” to type “System.Uri”. Error: “Invalid URI: The hostname could not be parsed.”
      Fully Qualified Error ID = CannotConvertArgumentNoMessage,Invoke-FogApi
      </Data>
      </EventData>
      </Event>

      I’ve tried a few things like putting the url directly instead of using $baseuri, even tried “$baseuri/restofurl” same issue. I’m not sure what I’m missing here.

      I know I’ve worked with a few guys on here with the FOG API via Powershell, so if I can get assistance, I appreciate it.

      posted in General
      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 API powershell help

      @jj-fullmer said in fog API powershell help:

      @jamaal I have a function for inventory here https://fogapi.readthedocs.io/en/latest/commands/Get-FogInventory/
      It gets the same inventory information via powershell and adds it to fog.
      I can also help you with queuing the native inventory task, but that might be a bit trickier. I think you can schedule more than one task for a machine when it’s a scheduled task, but I’m not sure.

      Glad I had the code for get-foggroups somewhere to be found. It looks like something weird happened to the get-foggroups function and all the code disappeared from it. I’ll need to get that fixed as soon as I can as that function is used all over the place. I have made an issue for it https://github.com/darksidemilk/FogApi/issues/3

      Thanks jj, appreciate it. And another question. So I read in the fog forums and also the general fog page that snapins for groups don’t function, correct? I created a group called sales and when I added snapins to it, they never stayed. I then started reading up on it and said the groups only serve mostly as a category for naming& imaging purposes.

      It would be create if there was a way to add snapins to groups so when the other technicians use Microsoft Forms for example, they select which group the pc will go to and then the pc will automatically have all the snapins.

      If somehow that gets done in future, please let me know. Or do you know of a powershell command to add multiple snapins at once? Ex; the tech would click on the checkbox on Microsoft Form for more than one snapin, so I need to create a powershell statement to group more than one snapin.

      posted in General
      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