Hey, I have a script which identifies if a user has a specific license and exports the data in a csv. The script works and I get the data I want but when I manipulate the data using a pivot table it doesn't add up. The reason for this is the data is a mix of TRUE, FALSE, BLANK and text (AccountSkuId) so the pivot table doesn't work. Below is the script:
Get-MsolUser -All | where {$.isLicensed -contains $true} | Select-Object DisplayName, {$.Licenses.AccountSkuId -eq "Blah:SPE_F1"}, {$.Licenses.AccountSkuId -eq "Blah:MCOEV"}, {$.Licenses.AccountSkuId -eq "Blah:ENTERPRISEPACK"}, {$_.Licenses.AccountSkuId -eq "Blah:MEETING_ROOM"}, {$_.Licenses.AccountSkuId -eq "Blah:POWER_BI_PRO"}, {$_.Licenses.AccountSkuId -eq "Blah:POWERAUTOMATE_ATTENDED_RPA"}, {$_.Licenses.AccountSkuId -eq "Blah:STANDARDPACK"} | export-csv C:\PS-CSV\LicenseUser1.csv
Is there a way to get round this so its consistent using PowerShell?
Thanks,