Microsoft 365 Licenses in PowerShell


Get-MsolAccountSku | 

    Where-Object AccountSkuId -eq "******:ENTERPRISEPREMIUM" |

    Select-Object -ExpandProperty ServiceStatus | 

    Select-Object -ExpandProperty serviceplan | 

    Sort-Object servicename |

    ft servicename


Get-MsolUser -UserPrincipalName "DiegoS@mydomainname" |

    Select-Object -ExpandProperty licenses |

    Select-Object -ExpandProperty servicestatus |

    Select-Object -ExpandProperty serviceplan | 

    Sort-Object servicename |

    ft servicename



Replace "******:ENTERPRISEPREMIUM" with your actual licence name.


Also see
https://gist.github.com/Tiberriver256/62f4167e6728f95bf342a485dbe0a4e9