Search code examples
powershellazurepowershell-cmdletsku

Find Sku if planName is given in PowerShell


I am new to AzureAD Powershell.

I have some ServicePlanName like Deskless ,SHAREPOINTSTANDARD, I want the correspondent SkuID (here O365PREMIUM's Skuld).

My input will be the ServicePlanName and the output should be SKUID. I don't know which command should be used in PowerShell.

Thanks!!


Solution

  • I suppose you want to get the SkuId via ServicePlanName, please try the command below, it works fine on my side.

    $licenses = Get-AzureADSubscribedSku | Where {$_.ServicePlans.ServicePlanName -eq "yourServicePlanName"}
    $licenses.SkuId
    

    enter image description here