I need a Export-CSV now

Hi

I’m beginner in PowerShell.

I use this Code for list all Users with phone number:
Get-CsOnlineUser | Where-Object { $_.LineURI -notlike $null } | ft DisplayName,UserPrincipalName,LineURI

I need a Export-CSV now. I’ve tried a variety of things, but somehow I’m not getting there.

Anybody have a tip?

Reto,
Welcome and Grüezi wohl to the forum. :wave:t3:

What exactly have you tried?

You may (re-)read the help for

Please read the help completely including the examples to learn how to use it.

Hi Olaf

Thanks for your answer and link. I’ll re read this information.

The last what i do was
Get-CsOnlineUser | Where-Object { $_.LineURI -notlike $null } | ft DisplayName,UserPrincipalName,LineURI | Export-Csv -Path C:\temp\report.csv -Delimiter ';' -NoTypeInformation

I’ll invest in a lonely time to find more for the exact command.

Yes, it works with

Get-CsOnlineUser | 
Where-Object  { $_.LineURI -notlike $null } | 
select DisplayName,UserPrincipalName,LineURI | 
Export-Csv C:\temp\blabla.csv

Good Day

Great that you figured it out by yourself. :+1:t3:

Explanation what was wrong:

Format cmdlets are mostly made to be used as the very last element of a pippeline. It almost never makes any sense to pipe the output of a format cmdlet - like Format-Table, Format-List or Format-Wide and so on - to a further cmdlet. They are meant to produce screen output only.