mirror of
https://github.com/admindroid-community/powershell-scripts.git
synced 2025-12-17 16:35:19 +00:00
Update O365UserLicenseReport.ps1
Added country in the report
This commit is contained in:
parent
6ab47325d5
commit
6b5d4cee87
@ -12,6 +12,7 @@ Function Get_UsersLicenseInfo
|
|||||||
$LicensePlanWithEnabledService=""
|
$LicensePlanWithEnabledService=""
|
||||||
$FriendlyNameOfLicensePlanWithService=""
|
$FriendlyNameOfLicensePlanWithService=""
|
||||||
$upn=$_.userprincipalname
|
$upn=$_.userprincipalname
|
||||||
|
$Country=$_.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
|
||||||
@ -92,10 +93,10 @@ Function Get_UsersLicenseInfo
|
|||||||
#Increment SKUid count
|
#Increment SKUid count
|
||||||
$count++
|
$count++
|
||||||
}
|
}
|
||||||
$Output=@{'Displayname'=$_.Displayname;'UserPrincipalName'=$upn;'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,LicensePlanWithEnabledService,FriendlyNameOfLicensePlanAndEnabledService | Export-Csv -path $ExportSimpleCSV -NoTypeInformation -Append
|
$Outputs | Select-Object Displayname,userprincipalname,Country,LicensePlanWithEnabledService,FriendlyNameOfLicensePlanAndEnabledService | Export-Csv -path $ExportSimpleCSV -NoTypeInformation -Append
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user