From a1ed272e1e7fd729cec69e5b362702f3db5d4b0f Mon Sep 17 00:00:00 2001 From: AdminDroid <49208841+admindroid-community@users.noreply.github.com> Date: Fri, 6 Dec 2019 11:57:58 +0530 Subject: [PATCH] Update O365UserLicenseReport.ps1 --- Office 365 User License Report/O365UserLicenseReport.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Office 365 User License Report/O365UserLicenseReport.ps1 b/Office 365 User License Report/O365UserLicenseReport.ps1 index 9c9a5dd..537214c 100644 --- a/Office 365 User License Report/O365UserLicenseReport.ps1 +++ b/Office 365 User License Report/O365UserLicenseReport.ps1 @@ -13,6 +13,10 @@ Function Get_UsersLicenseInfo $FriendlyNameOfLicensePlanWithService="" $upn=$_.userprincipalname $Country=$_.Country + if($Country -eq "") + { + $Country="-" + } Write-Progress -Activity "`n Exported user count:$LicensedUserCount "`n"Currently Processing:$upn" #Get all asssigned SKU for current user $Skus=$_.licenses.accountSKUId @@ -96,7 +100,7 @@ Function Get_UsersLicenseInfo $Output=@{'Displayname'=$_.Displayname;'UserPrincipalName'=$upn;Country=$Country;'LicensePlanWithEnabledService'=$LicensePlanWithEnabledService; 'FriendlyNameOfLicensePlanAndEnabledService'=$FriendlyNameOfLicensePlanWithService} $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 }