Forum Discussion
px091
Dec 07, 2021Iron Contributor
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...
- Dec 07, 2021Maybe you want to update to 3.0.0, 2.0 is pretty old
you can keep track of versions here https://msshells.net
Hello,
Do you get something in the .csv file?
Do you get something in the .csv file?
px091
Dec 07, 2021Iron Contributor
Andres, here is the info from output csv file
#TYPE Deserialized.System.Collections.Generic.List`1[[System.Management.Automation.PSObject System.Management.Automation Version=3.0.0.0 Culture=neutral PublicKeyToken=31bf3856ad364e35]]
PSComputerName RunspaceId PSShowComputerName Capacity Count IsFixedSize IsReadOnly IsSynchronized SyncRoot
api.interfaces.records.teams.microsoft.com 7de3aa65-628c-4971-90ca-73933355b8d1 FALSE 128 123 FALSE FALSE FALSE System.Object
#TYPE Deserialized.System.Collections.Generic.List`1[[System.Management.Automation.PSObject System.Management.Automation Version=3.0.0.0 Culture=neutral PublicKeyToken=31bf3856ad364e35]]
PSComputerName RunspaceId PSShowComputerName Capacity Count IsFixedSize IsReadOnly IsSynchronized SyncRoot
api.interfaces.records.teams.microsoft.com 7de3aa65-628c-4971-90ca-73933355b8d1 FALSE 128 123 FALSE FALSE FALSE System.Object
- px091Dec 07, 2021Iron ContributorI saw a customized code for retrieving subnet information, but don't know how to use this piece code
https://www.powershellgallery.com/packages/MicrosoftTeams/2.3.0/Content/net472%5Cexports%5CGet-CsOnlineLisSubnet.ps1 - Dec 07, 2021I tried the exact same command as you and, this is what I get:
"Description","LocationId","Subnet"
"","12afd15f-81bb-4307-8cc0-7e3143066d8c","10.10.10.128"
What is the version of the Teams module you are using?- px091Dec 07, 2021Iron ContributorAndres, 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)")
}- Dec 07, 2021Maybe you want to update to 3.0.0, 2.0 is pretty old
you can keep track of versions here https://msshells.net