Get-csOnlineLisSubnet | Export-csv not working


I am trying to retrieve all subnet information using the cmdlet. Get-csOnlineLisSubnet. this will give me a list of subnets. But when I tried to export it to csv using the folowing cmdlet, no subnets information are exported successfully 


Get-csOnlineLisSubnet | Export-csv c:\temp\subnets.csv


Thanks in advance

7 Replies
Do you get something in the .csv file?
Andres, here is the info from output csv file

#TYPE Deserialized.System.Collections.Generic.List`1[[System.Management.Automation.PSObject System.Management.Automation Version= Culture=neutral PublicKeyToken=31bf3856ad364e35]]
PSComputerName RunspaceId PSShowComputerName Capacity Count IsFixedSize IsReadOnly IsSynchronized SyncRoot 7de3aa65-628c-4971-90ca-73933355b8d1 FALSE 128 123 FALSE FALSE FALSE System.Object

I saw a customized code for retrieving subnet information, but don't know how to use this piece code
I tried the exact same command as you and, this is what I get:


What is the version of the Teams module you are using?

Andres, Thnaks a lot for your help! I use the 2.0 version of Microsoft.Teams. Finally I use the following code to get the subnets information I wanted. I still don't know why the export-csv cmdlet does not work.

$subnets = Get-csOnlineLisSubnet
foreach ($subnet in $subnets)
Write-Host("LocationID: $($subnet.LocationID) Subnet: $($subnet.Subnet) Description: $($subnet.Description)")
best response confirmed by px091 (Contributor)
Maybe you want to update to 3.0.0, 2.0 is pretty old

you can keep track of versions here
I update my Teams module to v3.0. The following cmdlet works right away. Thanks Andres for your help!

Get-csOnlineLisSubnet | Export-csv c:\temp\subnets.csv