Connect to Azure AD
Azure AD PowerShell Modunle
You need install MSOnline module only once. In the next time, run to connect to Azure AD PowerShell.
##Connect to MSOnline
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force;
Install-PackageProvider -Name NuGet -Force;
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted;
Install-Module -Name MSOnline;
Connect-MsolService;
##Get licenses status
Get-MsolAccountSku | Select-Object AccountSkuId, ActiveUnits, ConsumedUnits, SkuPartNumber, WarningUnits | Sort Name | Out-GridView;
#Get licenses status
New-Item -Path "$env:temp" -Name "O365" -ItemType "directory" -Force
Get-MsolAccountSku | Select-Object AccountSkuId, ActiveUnits, ConsumedUnits, SkuPartNumber, WarningUnits | Export-CSV $env:temp\o365\Licenses-Report.csv -NoTypeInformation -Encoding UTF8; ii $env:temp\o365
5/5 - (1 vote)