Replies: 1 comment 2 replies
-
Looks great, Thanks. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The idea was to get the exact same result as running
Get-MSolAccountSku
, let me know what you think.Connect-Graph "Directory.Read.All","Directory.ReadWrite.All","Organization.Read.All","Organization.ReadWrite.All"
$mgSubscribedSkus=Get-MgSubscribedSku
$LicensesReport = New-Object System.Collections.ArrayList
foreach($mgSubscribedSku in $mgSubscribedSkus){
$sku = New-Object PSObject
$sku | Add-Member -MemberType NoteProperty -Name SkuPartNumber -Value $mgSubscribedSku.SkuPartNumber
$sku | Add-Member -MemberType NoteProperty -Name ActiveUnits -Value $mgSubscribedSku.PrepaidUnits.Enabled
$sku | Add-Member -MemberType NoteProperty -Name WarningUnits -Value $mgSubscribedSku.PrepaidUnits.Warning
$sku | Add-Member -MemberType NoteProperty -Name ConsumedUnits -Value $mgSubscribedSku.ConsumedUnits
$LicensesReport.Add($sku)
}
$LicensesReport
Beta Was this translation helpful? Give feedback.
All reactions