bdevogt
1
Im trying to replace text within the select-object
[pre]
Get-MsolUser -all |Where-Object {$.islicensed -eq $true} | Select-Object signinname,licenses,@{Name=“test”; E={(‘licenses’ -replace '{reseller-account:O365’,‘’)}}
[/pre]
This isnt working, anyone have a better solution ?
Olaf
2
You have to specify the property you want to use for the replacement.
@{Name=“test”; E={($.licenses -replace '{reseller-account:O365’,")}
… if I got it right
bdevogt
3
[quote quote=174553][/quote]
Almost
now i get the following result
Test@test.nl {reseller-account:O365_BUSINESS_PREMIUM} Microsoft.Online.Administration.UserLicense
instead of
Test@test.nl {reseller-account:O365_BUSINESS_PREMIUM} BUSINESS_PREMIUM
bdevogt
4
Well what a way for microsoft to put another array in there
Get-MsolUser -all |Where-Object {$.islicensed -eq $true} | Select-Object signinname,licenses,@{Name=“test”; E={($.licenses.accountskuid -replace ‘reseller-account:O365_’,‘’)}}
is the solution.
Thanx @Olaf for pointing me in the right direction