The intent of this post is not to show every possible function possible or every function that I do managing MDM, but mostly to give people a starting point for getting information out of Airwatch aka Workspace ONE. For the latest on current APIs, check out https://as135.awmdm.com/api/help/#!/apis
$awBaseURL = 'https://as000.awmdm.com' #region creds $apiKey = '' $userName = 'readonlyuser' $pass = 'password' #endregion $concateUserInfo = $userName + ":" + $pass $encoding = [System.Text.Encoding]::ASCII.GetBytes($concateUserInfo) $encodedString = [Convert]::ToBase64String($encoding) $restUserName = "Basic " + $encodedString $headers = @{ Authorization = $restUserName 'aw-tenant-code' = $apiKey 'Accept' = 'application/json;version=2' 'Content-Type' = 'application/json' } #Devices $uuid='' $URLSuffixDeviceSearch = '/api/mdm/devices/search' $URLSuffixDeviceInfo = ('/api/mdm/devices/' + $uuid) $reqURI = $awBaseURL + $URLSuffixDeviceSearch $res = Invoke-RestMethod -Uri $reqURI -Method GET -Headers $headers $alldevices = $res.devices $enrolled = $alldevices | where {$_.EnrollmentStatus -eq 'Enrolled'} | select -Property UserName, EnrollmentStatus, UserEmailAddress, Platform, Model, ` OperatingSystem, LastSeen, SerialNumber, MacAddress, Udid, AssetNumber, DeviceFriendlyName, LocationGroupName, ComplianceStatus, ` CompromisedStatus, LastComplianceCheckOn | sort -property UserName $EnrolledUsers = $enrolled.userName | sort | select -unique