Forum Discussion
reshmeeauckloo
May 12, 2024Brass Contributor
Issue with get-sposite SPO PowerShell
Issue with SPO PowerShell get-sposite for all sites not returning the correct values for different properties SharingDomainRestrictionMode , LimitedAccessFileType, DefaultSharingLinkType, DefaultLink...
- May 13, 2024Unfortunately the MS case got closed as SPO PowerShell scripting was not supported by the support team.
The only way to get the correct properties is to iterate through each site
```
$sites = Get-SPOSite -Limit All | Select-Object -Property Url
$siteArray = @();
foreach($site in $sites)
{
$siteProp = Get-SPOSite -Identity $site.Url
$siteArray+=$siteProp
}
$siteArray | Select-Object -Property *
reshmeeauckloo
May 13, 2024Brass Contributor
Thanks Vasil. I have raised a Microsoft case to look into it and will wait to see what is their response if the ticket is passed to the correct team to look into.
reshmeeauckloo
May 13, 2024Brass Contributor
Unfortunately the MS case got closed as SPO PowerShell scripting was not supported by the support team.
The only way to get the correct properties is to iterate through each site
```
$sites = Get-SPOSite -Limit All | Select-Object -Property Url
$siteArray = @();
foreach($site in $sites)
{
$siteProp = Get-SPOSite -Identity $site.Url
$siteArray+=$siteProp
}
$siteArray | Select-Object -Property *
The only way to get the correct properties is to iterate through each site
```
$sites = Get-SPOSite -Limit All | Select-Object -Property Url
$siteArray = @();
foreach($site in $sites)
{
$siteProp = Get-SPOSite -Identity $site.Url
$siteArray+=$siteProp
}
$siteArray | Select-Object -Property *