A PowerShell API wrapper for the IBM MaaS360 Web Services API.
⚠️ WARNING: This is a work-in-progress and a complete rewrite of my original idea. Most functions are will not work for a few updates since they followed old design ideas. Please take this into account before cloning. If you have any issues please utilize the Github Issues or submit a pull request.
# Step 1. Install module from PowerShell Gallery via PowerShellGet
Install-Module -Name 'MaaS360PS'
# Step 2. Create a session to generate an API key
# NOTE: All parameters values are found in the MaaS360 portal under Setup > Documentation.
Connect-MaaS360PS -platformID '0' -BillingID '0123456789' -AppID '01234567_apple' -AppVersion '1.0' `
-AppAccessKey 'cIENUGZ' -Credentials 'your_email_address' -Method 'Post'
# Returns 'assumed successful' but the -Result switch can show more detail
Connect-MaaS360PS -Method 'Get'
# View details regarding your session such as [API KEY] and complete [URI]
Connect-MaaS360PS -Method 'Get' -Result
# Step 3 (optional). Test your connection to MaaS360 with the supplied API key.
Test-MaaS360PSConnection -Url https://apis.m3.maas360.com/ -Endpoint user-apis/user/1.0/search/ -BillingID '0123456789' -Method 'Get'
# Example Connect-MaaS360PS with [-DEBUG] and [-VERBOSE] for full visual of the command.
# [API KEY] and [BILLING ID] are not real
---
VERBOSE: Requested HTTP/1.1 POST with 443-byte payload
VERBOSE: Received HTTP/1.1 91-byte response of content type application/json
VERBOSE: Content encoding: utf-8
DEBUG: RAW API KEY: 7069c49e-8775-4032-ab59-940c39c07723-IOd45z3
DEBUG: URI: https://apis.m3.maas360.com/auth-apis/auth/1.0/authenticate/01234567
DEBUG: SECURE API KEY: System.Security.SecureString
Successfully obtained API KEY.
DEBUG: URI: https://apis.m3.maas360.com/user-apis/user/1.0/search/01234567
DEBUG: TOKENIZED API KEY: MaaS token="7069c49e-8775-4032-ab59-940c39c07723-IOd45z3"
VERBOSE: Requested HTTP/1.1 GET with 0-byte payload
VERBOSE: Received HTTP/1.1 response of content type application/json of unknown size
VERBOSE: Content encoding: utf-8
DEBUG: Debug response: @{users=}
DEBUG: Connection to [https://apis.m3.maas360.com/user-apis/user/1.0/search/01234567] successful.
Connection to your MaaS360 instance is fully confirmed. Feel free to use all commands.
---
# Utilize PowerShell's discoverability to learn more about functions and their usages.
Get-Help about_MaaS360PS
Get-Command -Module 'MaaS360PS'
Get-Help Get-MaaS360User -ShowWindow