You have post this script :
$MCUsername = "MobiControl username goes here"
$MCPassword = "MobiControl Password goes here"
$MCFQDN = "MobiControl FQDN Goes here"
$ClientID = "MobiControl API Client ID Goes here"
$ClientSecret = "MobiControl Client Secret Goes here"
# You may want to figure out a way to encrypt the Password and the Secret, that's best practice
$IDSecret = $ClientID + ":" + $ClientSecret
$EncodedIDSecret = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($IDSecret))
$Body = @{}
$Body["grant_type"]="password"
$Body["username"]=$MCUsername
$Body["password"]=$MCPassword
$Header = @{}
$Header["Authorization"] = "Basic " + $EncodedIDSecret
try
{
$response = Invoke-restmethod -Uri https://$MCFQDN/mobicontrol/api/token -Method POST -Headers $Header -Body $Body
}
catch
{
$($_.Exception.Message)
}
$Token = $response.access_token
Write-Host "My MobiControl API Token is: $Token"
#Now you can use the Token in other API calls by refering to the Token Variable.
I want to send this script via the console script below via the powershell api call:
sendintent -a "intent:file:///sdcard/clochecausses.mp3#Intent;type=audio;component=com.android.music;end"
Can you add an exemple please ?
In this script where to find client ID and client secret in the web console ( it is the name of the device ?, client secret is pin code ? )
Thanks a lot.