IA API PS example

# Ivanti Automation Basic WebAPI variables

$secpasswd = ConvertTo-SecureString  "<password>"  -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ( "webapi" , $secPasswd)
$url = "https://iawebapi.automatedvision.info:8081//Dispatcher/SchedulingService/jobs"

$body = '{
"Description":" Send message ",
"When": {
    "Immediate":true,
    "IsLocalTime": true,
    "UseWakeOnLAN": false
},
"What": [{
    "ID":" 3C53B06D-009C-42F5-B497-99CA03EA5595 ",
    "Type": 0,
    "Name":" Send Message "
}],
"Who": [{
    "ID":" 2CD345BF-F85B-48F5-A671-173100C39639 ",
    "Type": 0,"Name":" SB-MS-BH01 "
}]
}'

# Execute Web-API to schedule a module

Invoke-WebRequest -Uri $url -Method Post -Credential $mycreds -ContentType "application/json" -Body $body