Forum Discussion
Dennis-Scherrer
Mar 26, 2025Brass Contributor
Sort SharePoint Online organization properties
There`re more than 200 organization properties in SPO.
Whenever I just want to find out the status of a selected property, I realize that Get-SPOTenant isn`t very admin-freandly 😥 it won´t support sort or filter, because output of this command doesn't include columns like Get-SPOSite do. I may be wrong, but can someone tell me how to sort by name of properties in output of Get-SPOTenant?
Thank you michalkornet
With your code I was able to build a small script that gives me a sorted list.
$properties = Get-SPOTenant $propertiesArray = $properties.PSObject.Properties | ForEach-Object { [PSCustomObject]@{ Name = $_.Name; Value = $_.Value } } $propertiesArray | Sort-Object -Property Name
- michalkornetIron Contributor
Get-SPOTenant returns a single value with properties so this is the reason why filtering is not available. So if the case it to filter by properties maybe you can try something like this.
$properties = Get-SPOTenant $propertiesArray = $properties.PSObject.Properties | ForEach-Object { [PSCustomObject]@{ Key = $_.Name; Value = $_.Value } } $filteredProperties = $propertiesArray | Where-Object { $_.Key -eq "Name" } $filteredProperties
- Dennis-ScherrerBrass Contributor
Thank you michalkornet
With your code I was able to build a small script that gives me a sorted list.
$properties = Get-SPOTenant $propertiesArray = $properties.PSObject.Properties | ForEach-Object { [PSCustomObject]@{ Name = $_.Name; Value = $_.Value } } $propertiesArray | Sort-Object -Property Name