Skip to content

Instantly share code, notes, and snippets.

View gist:4396572e8e76dc02c70e1c5c4b7dafe0
package com.vmware;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
public class restexample {
public static void main(String[] args) {
View Main
package com.vmware;
public class restexample {
public static void main(String[] args) {
}
}
View Post - Profile - cURL Example
curl -X POST
--header 'Content-Type: application/json' \
--header 'Accept: application/json;version=2' \
--header 'Authorization: Basic SGF3YWlpNG1l' \
--header 'aw-tenant-code: a/D3ariE08ltuYjgecv2jnW/mi41in3lYUd9vHlK0hk=' \
-d '{ \
"AndroidForWorkWifiList": [ \
{ \
"ServiceSetIdentifier": "devtest", \
"SecurityType": "WPA", \
View Post - Profile - JSON Request Body
{
"AndroidForWorkWifiList": [
{
"ServiceSetIdentifier": "devtest",
"SecurityType": "WPA",
"Password": "12345678",
"SetAsActiveNetwork": true,
"HiddenNetwork": false,
"EnterprisePassword": "12345678"
}
View Get - Profile - JSON Response
{
"AndroidForWorkWifiList": [
{
"ServiceSetIdentifier": "devtest",
"SecurityType": "WPA",
"Password": "*****",
"SetAsActiveNetwork": true,
"HiddenNetwork": false,
"EnterprisePassword": "*****"
}
View gist:a8c34e6da7c2aee5ed0112ab5f0c303f
curl --location --request GET 'https://ws1.ryanpringnitz.com/API/mdm/profiles/86' \
--header 'Accept: application/json;version=2' \
--header 'Authorization: Basic SGF3YWlpNG1l' \
--header 'aw-tenant-code: a/D3ariE08ltuYjgecv2jnW/mi41in3lYUd9vHlK0hk=' \
View DeleteUsers.ps1
$VerbosePreference = "Continue"
$script:Credentials = Get-Credential
Try {
$script:Username = $credentials.username
$script:Password = $credentials.GetNetworkCredential().password
}
Catch {
$_.Exception.Message
Continue
}
@HawaiiRyan
HawaiiRyan / MoreSecureAtRuntime.ps1
Last active May 2, 2020
Get-credentials and base64 encode credentials at runtime to access Workspace ONE UEM API's
View MoreSecureAtRuntime.ps1
$VerbosePreference = "Continue"
$script:config = "config.ini"
Write-Verbose -Message "The username is in the format domain\samAccountName"
function Test-APICred {
[CmdletBinding()]
[OutputType([String])]
Param (
[Parameter(
Mandatory = $true,
ValueFromPipeLine = $true,
@HawaiiRyan
HawaiiRyan / GoogleChrome-AndroidUpdate.ps1
Last active Apr 1, 2020
Google Chrome App Update Tool - Android
View GoogleChrome-AndroidUpdate.ps1
######Howto use script
# 1. Create config.ini file
# 1a. Config.ini file example at following URL: https://gist.github.com/HawaiiRyan/b610f6d5427afa9609cee145affed912
# 2. Update -path location in the line where variable/object $WS1Env is declared
# 3. Ensure $addy, $b64, $apikey are referencing the correct environment.
# 3a. UAT environment is used in this example
#Set Verbosity Preference
$VerbosePreference = "Continue"