I took this script from that post : Office 365 Powershell but when I run it, I receive that error :
WARNING: More results are available. Please specify one of the All or MaxResults parameters.
Where do I need to add the maxresults parameters in order to make the export possible?
$lines = @() foreach($msolUser in (Get-MSOLUser -ALL | where {$_.isLicensed -eq $true})) { $UserInfo = Get-User -identity $msolUser.UserPrincipalName foreach($license in $msolUser.Licenses) { $lines += New-Object PsObject -Property @{ "Nom/Prenom"="$($UserInfo.DisplayName)"; "Societe"="$($UserInfo.Company)"; "AdressePrincipale"="$($UserInfo.UserPrincipalName)"; "Licences"="$($license.AccountSKUid)" } } } $lines | Export-CSV C:\out1.csv -Delimiter ";" -Encoding Unicode