Forum Discussion

reshmeeauckloo's avatar
reshmeeauckloo
Brass Contributor
May 12, 2024

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, DefaultLinkPermission etc,

If get-sposite -Identity <siteurl> is used, the correct values for the properties are returned.

 

It seems to be an issue with the underlying CSOM. Can someone at Microsoft help with this? I have raised case #‎2405120050000021 for this. My previous experience raising a case related to SPO PowerShell was closed because SPO PowerShell was not supported by the team handling the case. 

  • reshmeeauckloo's avatar
    reshmeeauckloo
    May 13, 2024
    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 *
  • Just to clarify, you mean that the value for some properties is empty/wrong when using the generic "LIST" method, but correct when using the individual "GET" one? If that is the case, then this is by design - some properties are considered "expensive" and only populated when fetching individual objects and not the whole collection. Same principle is used across other workloads too, not just SPO.
    • reshmeeauckloo's avatar
      reshmeeauckloo
      Brass 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's avatar
        reshmeeauckloo
        Brass 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 *

Resources