pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
985 stars 665 forks source link

Get-PnPTenantSite -Detailed #2598

Closed rudyampey closed 4 years ago

rudyampey commented 4 years ago

Reporting an Issue or Missing Feature

Running the Get-PnPTenantSite -Detailed cmdlet does not display the actual value of attributes.

Expected behavior

The expected behavior is that Get-PnPTenantSite -Detailed will return all sites with the correct attribute values based on the following verbiage "By default, not all returned attributes are populated. This switch populates all attributes. It can take several seconds to run. Without this, some attributes will show default values that may not be correct."

Actual behavior

Attributes display the incorrect values for example attributes that have GUID data types (GroupId, HubSiteId, RelatedGroupId, SensititvityLabel) display the value 00000000-0000-0000-0000-000000000000 and true/false attribute values like IsHubSite and IsGroupOwnerSiteAdmin return false for all sites.

The correct attribute values are only returned by looping through all sites and executing Get-PnPTenantSite on each site with the -Url parameter specified. The following Get-PnPTenantSite | ForEach-Object { Get-PnPTenantSite -Url $_.Url | select Title,Url,GroupId,IsGroupOwnerSiteAdmin } will return the actual GroupId and IsGroupOwnerSiteAdmin values.

Steps to reproduce behavior

  1. Connect-PnPOnline -Url https://yourspodomain-admin.sharepoint.com
  2. Get-PnPTenantSite -Detailed or Get-PnPTenantSite -Detailed:$true

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

The cmdlet has been executed using version 3.18.2002.0 and 3.19.2003.0

How did you install the PnP-PowerShell Cmdlets?

ghost commented 4 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

wobba commented 4 years ago

I would defer this as an API bug to be logged at sp-dev-docs.

We set IncludeDetail=true in the SPOSitePropertiesEnumerableFilter request when using Tenant.GetSitePropertiesFromSharePointByFilters . Doing fixes in PnP to remedy this seems not to be the right approach.

wobba commented 4 years ago

Duplicate of #2596