0

To Manage the Access requests to access the sites, I've to configure access request settings in SharePoint 2016 on premises ,by Going to --> Settings -->> Site Settings -->Click the "Site permissions" link under "Users and permissions" section.

Now, from the ribbon, Click on “Access Request Settings” button. I'll be prompted with the access request Settings popup window. then Click on "Allow access request" option to enable access request and enter the E-mail address of the user who will receive access requests from that site.

Up to this everything is clear to me and it is all working fine. Since I've hundreds of sub site and many site collections, Is there any easy way to do this procedure for all the site collection through PowerShell script or any other options in central admin ?

If anyone has a solution for this, please share it , that would be really helpful.

Thanks in Advance.

0

For using PowerShell to edit the access request settings, you can refer to the script in the blog below.

https://ehikioya.com/sharepoint-access-requests-powershell/

You can either change the access request settings or change the email address which will receive the request email.

0

To replace the Access Request email on all sites and subsites use below PowerShell code:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue 
  
$webapp = Get-SPWebApplication https://sharepoint.contoso.com  
$requestemail = "new-request-recipient@demo.com"   
  
foreach($site in $webapp.Sites)  
{  
   foreach($web in $site.AllWebs)  
   {  
     $url = $web.url  
     Write-host "Checking "$url  
     if (!$web.HasUniquePerm)  
     {  
            Write-Host "Site inherits Access Request settings from parent." -ForegroundColor Yellow  
     }  
     else  
     {  
       if($web.RequestAccessEnabled)  
       {  
            Write-Host "Site utilizes Access Requests."   
            $web.RequestAccessEmail = $requestemail  
            $web.Update()  
            Write-Host "Email changed to " $requestemail -ForegroundColor Green
        }  
            else  
      {  
            Write-Host "Site is not utilizing Access Requests." -ForegroundColor Yellow  
      }  
   }  }
}

You will need to replace the $webapp and $requestemail values at the top with your values.

Reference: Change the email address used for Access Requests on all SharePoint sites and subsites in a web app using PowerShell

Additional Reference: Change All SharePoint Site's Access Request Emails with PowerShell

1
  • Hi @Jegan, Does this answers your question? If Yes, Please Upvote(^) and accept as an Answer as it will help others with same problem in future. It also removes this question from "Unanswered questions" list. If you have any doubt please ask here. Nov 24 '20 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.