Update O365UserLicenseReport.ps1

This commit is contained in:
AdminDroid 2019-12-06 11:57:58 +05:30
parent 6b5d4cee87
commit a1ed272e1e

View File

@ -13,6 +13,10 @@ Function Get_UsersLicenseInfo
$FriendlyNameOfLicensePlanWithService="" $FriendlyNameOfLicensePlanWithService=""
$upn=$_.userprincipalname $upn=$_.userprincipalname
$Country=$_.Country $Country=$_.Country
if($Country -eq "")
{
$Country="-"
}
Write-Progress -Activity "`n Exported user count:$LicensedUserCount "`n"Currently Processing:$upn" Write-Progress -Activity "`n Exported user count:$LicensedUserCount "`n"Currently Processing:$upn"
#Get all asssigned SKU for current user #Get all asssigned SKU for current user
$Skus=$_.licenses.accountSKUId $Skus=$_.licenses.accountSKUId
@ -96,7 +100,7 @@ Function Get_UsersLicenseInfo
$Output=@{'Displayname'=$_.Displayname;'UserPrincipalName'=$upn;Country=$Country;'LicensePlanWithEnabledService'=$LicensePlanWithEnabledService; $Output=@{'Displayname'=$_.Displayname;'UserPrincipalName'=$upn;Country=$Country;'LicensePlanWithEnabledService'=$LicensePlanWithEnabledService;
'FriendlyNameOfLicensePlanAndEnabledService'=$FriendlyNameOfLicensePlanWithService} 'FriendlyNameOfLicensePlanAndEnabledService'=$FriendlyNameOfLicensePlanWithService}
$Outputs= New-Object PSObject -Property $output $Outputs= New-Object PSObject -Property $output
$Outputs | Select-Object Displayname,userprincipalname,Country,LicensePlanWithEnabledService,FriendlyNameOfLicensePlanAndEnabledService | Export-Csv -path $ExportSimpleCSV -NoTypeInformation -Append $Outputs | Select-Object Displayname,userprincipalname,Country,LicensePlanWithEnabledService,FriendlyNameOfLicensePlanAndEnabledService | Export-Csv -path $ExportSimpleCSV -NoTypeInformation -Append
} }