Hi All,
I need to format the below script result, especially in the License (s) column to not show the company name.
$Office365VanityDomain = 'CorpFinanceLtd'Get-MsolUser -All -EnabledFilter EnabledOnly |
Where {$.IsLicensed -eq $true } |
Select DisplayName,UsageLocation,Licenses, @{Label = ‘License(s)’;
Expression = {
($.Licenses | ForEach-Object { ($.AccountSkuId | Where-Object { $.AccountSkuId -like $Office365VanityDomain }) -replace ‘$Office365VanityDomain:’ } ) -join ‘;’
}
},SignInName,UserPrincipalName,@{n=“ProxyAddresses”;e={$_.ProxyAddresses}} | ft -AutoSize
The default Licenses column shows the license information like:
{CorpFinanceLtd:MCOPSTNC, CorpFinanceLtd:ENTERPRISEPREMIUM, CorpFinanceLtd:EMSPREMIUM, CorpFinanceLtd:RIGHTSMANAGEMENT_ADHOC…}
So how do I remove the CorpFinanceLtd: prefix part, so it makes more meaningful result?
Thank you in advance.