Skip to content

[BUG] Get-PnPTenantSite does not True values for RestrictContentOrgWideSearch or RestrictedAccessControl when returning all sites #5034

@nikki-c

Description

@nikki-c

Reporting an Issue or Missing Feature

Get-PnPTenantSite to return details on all sites in the tenant then it does not return the correct values for RestrictContentOrgWideSearch or RestrictedAccessControl even when the values are set via Set-PnPTenantSite or via the SharePoint Admin center.

If I use
https://nikkichapple.sharepoint.com/teams/13Team

Expected behavior

When I set the Restricted Content Discovery or the Restricted Access Control values using with PNP PowerShell
Set-PnPTenantSite -Identity $testsite -RestrictContentOrgWideSearch $true
Set-PnPTenantSite -Identity $testsite -RestrictedAccessControl $true
Or directly in the SharePoint admin center

Then I run Get-PnPTenantSite -Detailed | ft Url, Template, ArchiveStatus, TeamsChannelType, RestrictContentOrgWideSearch, RestrictedAccessControl
I would expect RestrictContentOrgWideSearch and RestrictedAccessControl to equal True

Actual behavior

The RestrictContentOrgWideSearch and RestrictedAccessControl values are shown as False

Image

However if I run Get-PnPTenantSite for a specific site
Get-PnPTenantSite -Identity $testsite | ft Url, Template, ArchiveStatus, TeamsChannelType, RestrictContentOrgWideSearch, RestrictedAccessControl

the the values are correctly returned as True

Image

Steps to reproduce behavior

Please include complete script or code samples in-line or linked from gists

Example of setting site properties on a specific site

$testsite1 = "https://nikkichapple.sharepoint.com/teams/13Team"

Set site to restrict content org-wide search and enable restricted access control

Set-PnPTenantSite -Identity $testsite1 -RestrictContentOrgWideSearch $true
Set-PnPTenantSite -Identity $testsite1 -RestrictedAccessControl $true

Get specific site with detailed information

Get-PnPTenantSite -Identity $testsite1 | ft Url, Template, ArchiveStatus, TeamsChannelType, RestrictContentOrgWideSearch, RestrictedAccessControl

Get all sites with detailed information

Get-PnPTenantSite -Detailed | ft Url, Template, ArchiveStatus, TeamsChannelType, RestrictContentOrgWideSearch, RestrictedAccessControl

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

Manifest 3.1.0 PnP.PowerShell

Which operating system/environment are you running PnP PowerShell on?

  • [yes ] Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions