Powershell Automation for Licenses of O365 in Azure Automation RRS feed

  • Question

  • I use the Get-MsolUser command with $_.Licenses[0].ServiceStatus[X].ProvisioningStatus -eq "Disabled" in a script to check, if all Services for users inside a defined Group have been enabled/disabled correctly. If not, they get their -licenseoptions set newly.

    All this is automated in Azure Automation. I'm afraid my runbook will fail, when new Services will be added to O365 and the numbers in the Array: "ServiceStatus[X]" will Change and f.e. Exchange Online Service Plan 2 will no longer be ServiceStatus[15] and Change to ServiceStatus[16] or something else.

    Has anybody any ideas how to get around this?

    Thanks for any help!

    Wednesday, August 9, 2017 1:05 PM


All replies