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

    Topics created by scottybullet

    • S

      API - Powershell Create host and Deploy task script

      Tutorials
      • • • scottybullet
      3
      1
      Votes
      3
      Posts
      2.0k
      Views

      J

      @scottybullet

      This was very helpful! Thanks for sharing this.
      I used it with Microsoft Forms which goes back a SharePoint list, then talks to Microsoft
      Orchestrator with all the variables, ex; image name, MAC, etc…

    • S

      Solved API - Create Host Deploy Task "error": "Invalid tasking type passed"

      FOG Problems
      • • • scottybullet
      11
      0
      Votes
      11
      Posts
      1.6k
      Views

      J

      @Sebastian-Roth said in API - Create Host Deploy Task "error": "Invalid tasking type passed":

      @Jamaal From the error message I would imagine that this last call is failing because an earlier query also failed and variables are not being set correctly because of the earlier error. So you need to post the full error you see!

      I am not a PowerShell wiz but from what I know the read-host stuff you added should work.

      Thanks man, you pointed me in the right direction.
      So I went back to your script again and ran it and noticed it kept giving an error message after the 1st throw command, like Powershell was skipping the 2nd and 3rd throw command.

      What I had to do was do a read-host, but kept the $ (read-host “enter machine name”) for example:

      [String] $MachineName = $( read-host “Provide the target machines Name”),
      [String] $MacAddress = $(Read-Host “Provide the target machine Address”),
      [String] $ImageName = $(read-host “Provide the Image Name to assign to the new target host”)
      So I saw the task in the task list right away. I’m so so with powershell and starting to get better with it, you know. What I would like to do is maybe figure out powershell commands to add the snapins as a read-host so the tech can select which snapins to use instead of going to the Fog console to be more automatic.

      And I would like Powershell to start the task once the hostname is added to Fog. I can start playing around that.

    • S

      Solved API - Create Host "error": "Required database field is empty"

      FOG Problems
      • • • scottybullet
      4
      0
      Votes
      4
      Posts
      863
      Views

      S

      Got it, this is the syntax from Powershell

      $HostJson = @{
      “name”= $vmname
      “description”= $Description
      “macs” = @($MacAddress)
      “imageID”= $Image.id
      “imagename” = $ImageName
      }
      $CreateHostJson = ConvertTo-Json($HostJson)
      $createHostURL = $baseUri +“/host/create”
      $createHostResult = Invoke-RestMethod -Uri $createHostURL -Method POST -body $CreateHostJson -Headers $headers -ContentType “application/json”

    • 1 / 1