

Out-File -FilePath $outfile -InputObject $header $header = “userPrincipaName,usageLocation,isLicensed,accountSKUid,servicePlan1,provisioningStatus1,servicePlan2,provisioningStatus2,servicePlan3,provisioningStatus3,servicePlan4,provisioningStatus4,servicePlan5,provisioningStatus5” $defaultfolder = $Env:UserProfile + “\documents” Import-Module MSOnline -ErrorAction Silentl圜ontinueĬonnect-MsolService -Credential $cred -errorAction silentl圜ontinue -errorvariable $er Write-host “Please download and install the Microsoft Online Services Module.” Write-Host “The Microsoft Online Services Module for PowerShell is not installed. If (!(::Exists((“\modules\msonline\.PSModule.dll” -f $pshome)))) # verify that the MSOnline module is installed and import into current powershell session Write-Error “Operation cancelled by user.” $OpenFileDialog.filter = “All files (*.*)| *.*” $OpenFileDialog.initialDirectory = $initialDirectory # The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. # The sample scripts are provided AS IS without warranty of any kind.

# The sample scripts are not supported under any Microsoft standard support program or service.

# Script to retrieve a licensing report from Office 365 and output it to CSV They found nothing that would do this in their quick technical answers and they would have to get back to me.Īfter a bit of research on my own, I ended up creating my own script to get the information. I asked if there was a way to do this with Powershell and I got sent off to technical support. You can imagine my surprise when Microsoft billing told me the only way to do this was to go down each user in the administrative portal, click on them and check the licensing page to see what license is assigned. I recently got asked by one of my clients to check what users were on what plan in their Microsoft Office 365 account.
