Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get Office365 Licenses using PowerShell. Associated blog post can be found here
# Licenses
$Licenses = Invoke-RestMethod -Method Get -Headers @{
Authorization = $authenticationResult.CreateAuthorizationHeader()
'Content-Type' = "application/json"
} -Uri ("{0}/subscribedSkus?api-version=1.6" -f $authenticationResult.TenantId)
# All Licenses avail
# Query to get the skuId for the skuPartNumber of ExchangeStandard_Student
$LicenceToAdd = $Licenses.value.skuId | Where-Object{$licenses.value.skuPartNumber -eq 'EXCHANGESTANDARD_STUDENT'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.