Commit 2555c18c authored by Jos Lieben's avatar Jos Lieben

invoke-azure reprocess group memberships

parent 81cb07b4
function Invoke-AzHAPIReprocessGroupLicenses{
<#
.SYNOPSIS
reprocesses group license assignment
.NOTES
Author: Jos Lieben
.PARAMETER AzureRMToken
Use Get-azureRMToken to get a token for this parameter
.PARAMETER groupGUID
GUID of the group to reprocess licenses of
Requires:
- Global Administrator Credentials (non-CSP!)
- AzureRM Module
- supply result of get-azureRMToken function
#>
param(
[Parameter(Mandatory = $true)]$AzureRMToken,
[Parameter(Mandatory = $true)]$groupGUID
)
$header = @{
'Authorization' = 'Bearer ' + $AzureRMToken
'X-Requested-With'= 'XMLHttpRequest'
'x-ms-client-request-id'= [guid]::NewGuid()
'x-ms-correlation-id' = [guid]::NewGuid()
}
$url = "https://main.iam.ad.ext.azure.com/api/AccountSkus/Group/$groupGUID/Reprocess"
Invoke-RestMethod –Uri $url –Headers $header –Method POST -Body $Null -UseBasicParsing -ErrorAction Stop -ContentType "application/json"
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment