SharePoint Hub: Is it possible to give stakeholders access to some pages at once but not all?

Helena van Eek 1 Reputation point
2022-09-02T19:47:37.49+00:00

I would like to give access to members to all pages but one specific one. Is there a way without them having to request the access for each site/folder?

SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,405 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emily Du-MSFT 26,471 Reputation points Microsoft Vendor
    2022-09-05T07:57:22.257+00:00

    @Helena van Eek

    Based on your description, I understand that you want to grant permission for a group in some site collections. You could achieve through following PowerShell.

    Note: The account to be used in the PowerShell should be the administrator of these site collections.

    1.Create a csv file as following picture shows.

    237752-image.png

    2.Please run below PowerShell.

      $Credentials=Get-Credential  
      $DomainGroup = "DomainGroup1@domain.com"  
      $PermissionLevel = "Contribute"  
    
      $filePath = “the local path of csv file, such as C:\sites.csv”  
    
      $csv = Import-Csv $filePath  
      $a = $csv.Url  
    
      ForEach($_ in $a) {  
    
           Connect-pnponline $_ -Credential $Credentials  
    
           Set-PnPWebPermission -User $DomainGroup -AddRole $PermissionLevel  -Identity "/"  
    
      }  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.