Skip to content

CondtionalAccessPolicy Erroneous When Using Tenant.GetSitePropertiesByFilter method #8012

@rednender

Description

@rednender

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

not applicable

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version
  • SPFx version
  • Node.js version
  • etc
    This is experienced using the latest versions of PnP.PowerShell (1.10.0) and Microsoft.Online.SharePoint.PowerShell in both PowerShell 7.3 and Windows PowerShell.

Describe the bug / error

When sites are returned using Tenant.GetSitePropertiesByFilter method, the ConditionalAccessPolicy property is erroneously populated with "AllowFullAccess".

Review the following issue for more detail. pnp/PnP-PowerShell#2596. Comment section points towards this method as having the issue.

Steps to reproduce

#Reproduce with PnP.PowerShell

  1. Connect-PNPOnline -Url -Interactive
  2. $Sites = Get-PNPTenantSite -Detailed #Can reproduce with our without -Detailed Property
  3. $Sites[IndexOfSite] | Select ConditionalAccessPolicy #ConditionalAccessPolicy will show AllowFullAccess regardless if it's changed
  4. Get-PNPTenantSite -Identity | Select ConditionalAccessPolicy #Shows correct property value.

#Alternative with Microsoft.Online.SharePoint.Powershell

  1. Connect-SPOService -Url
  2. $Sites = Get-SPOSite -Limit All
  3. $Sites[IndexOfSite] | Select ConditionalAccessPolicy #ConditionalAccessPolicy will show AllowFullAccess regardless if it's changed
  4. Get-SPOSite -Identity | Select ConditionalAccessPolicy #Shows correct property value.

Expected behavior

CondtionalAccessPolicy property is returned correctly when using Tenant.GetSitePropertiesByFilter method. So both PNP.PowerShell and Microsoft.Online.SharePoint.Powershell return the correct property value when more than one site is returned using either Get-PNPTenantSite or Get-SPOSite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:csom/rest/apiCategory: SharePoint Client Side Object Model SDK / REST APItype:archive-old-issueIssues which are closed as tool old for active worktype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions