Set SharePoint access requests to owner group

Copper Contributor

How can I set the Access Request Settings to the Owner group on an O365 SharePoint site ?

I could not find any method in PnP PowerShell or CSOM... Set-PnPRequestAccessEmails only allows to set emails, not to select the site owner group.

 

The option is available through the UI though :

 

AccessRequestSettings.png

21 Replies

It's set to Site Owner Group by default . You don't need to set it. If you need to send the request to a different email address  you can still do it using the same powershell.

Nop. On my tenant by default access requests are defined to be sent to the user who created the site. Quite annoying when you have to handle a large number of sites. 

@Stephen Rice - I know you were looking for feedback and pretty involved in the Access Request piece, have any insights on this one? 

@Fouziya,


Is the default group listed in the UI screenshot still a valid group on the site? In cases where no secondary address has been set and the default group is not available, I believe we fall back to the site creator. Thanks for confirming!

 

Stephen Rice

OneDrive Program Manager II

@Stephen Rice

 

Hi - this isnt the same as being able to set the site to use the Owners group through script. this would be very useful to us as I would now like to set all of our existing sites (which are currently using hardcoded email addresses) to using the Owners group to service access requests.

 

Im kind of hoping the PnP Powershell Cmdlets might include an option for doing that - what do you think @Vesa Juvonen could we get that added to the "To Do" list?

 

Thanks

 

Nigel

Currently, this information is not exposed with the REST/CSOM APIs, so it cannot be controlled by using remote options (SPO or PnP PowerShell or code). We are looking into exposing this API with the CSOM in future, but there's no ETA for that work.

Hello @Vesa Juvonen

 

Is there any progress with this topic. Or at least clarify how it should be used when we want to configure web owner group?

We are looking for this right now as the requests are not processed.

Have a nice day

P. 

@Vesa Juvonen 

Any updates for exposing the API in CSOM or Rest API? Thank  you.

 

Hi @Long Liang ,

 

There should be some new updates to CSOM to allow access request settings to be modified. Thanks!

 

Stephen Rice

OneDrive Program Manager II

Thank you very much, I thought I missed the update from https://developer.microsoft.com/en-us/office/blogs/new-sharepoint-csom-version-released-for-sharepoi....

 

It's great to have this update, thank you.

@Nigel Witherdin 

we have suffering with same issue , we have large number of Sites which was created before which site Accesses request is going to  Hard code  email , we want this site Access request to site owners ,any  solution appreciated.

Yagie72

 

@Fouziya 

 

To enable this email setting and send the notification to the owner, use the below PnP PowerShell snippets .
 
  1. $cred = Get-Credential    
  2. Connect-PnPOnline -Url https://.sharepoint.com -Credential $cred    
  3. Set-PnPRequestAccessEmails -Emails ktskumar@<tenant>.onmicrosoft.com  
To add multiple emails to the settings, use the below cmdlet.
 
  1. Set-PnPRequestAccessEmails -Emails @( ktskumar@<tenant>.onmicrosoft.com; user1@<tenant>.onmicrosoft.com )    
The below PnP Powershell snippet is used to get the emails associated to allow access requests settings.
 
  1. $cred = Get-Credential      
  2. Connect-PnPOnline -Url https://.sharepoint.com -Credential $cred      
  3. Get-PnPRequestAccessEmails 

 

Source:
https://www.c-sharpcorner.com/blogs/allow-access-requests-email-settings-in-sharepoint-site-using-pn... 

@Vesa Juvonen 

We also need to change the "Access Request" method to set to Owner Group as it is possible through interface.

We are writing a CSOM method to create site from template and the "access request" option need to be set in the code using CSOM.

Please, tell me if any update of CSOM library is forecast or give any solution to update this option by code using any other library...

Regards.

@EricD35 

 

Hi, 

 

I think this will help:

 

https://sharepoint.stackexchange.com/questions/239489/sharepoint-pnp-powershell-how-to-provision-sub...

 

#Connect to Site Collection$me = Get-Credential
Connect-PnPOnline -Url  https://mytenet.sharepoint.com/sites/MySiteCollection -Credentials $me

#Create sub web with unique permissions
New-PnPWeb -Title "ProjectB Web" -Url ProjectB -Description "Information about ProjectB"  -BreakInheritance -InheritNavigation -Template "STS#0"

Connect-PnPOnline -Url "https://mytenet.sharepoint.com/sites/MySiteCollection/ProjectB" -Credentials $me
$owner = (Get-PnPContext).Credentials.UserName

#Create default groups for the new web
#here, by default owner will be the person provisioning the groups$ownerGroup = New-PnPGroup -Title "ProjectB Web Owners" -Owner $ownerSet-PnPGroup -Identity $ownerGroup -SetAssociatedGroup Owners$memberGroup = New-PnPGroup -Title "ProjectB Web Members"  -Owner $ownerSet-PnPGroup -Identity $memberGroup -SetAssociatedGroup Members$visitorGroup = New-PnPGroup -Title "ProjectB Web Visitors" -Owner $ownerSet-PnPGroup -Identity $visitorGroup -SetAssociatedGroup Visitors

#Apply template with groups.  Templates applies OK, but groups are not defined  
Apply-PnPProvisioningTemplate -Path C:\ProjectSiteTemplate.xml -Web projectB

 

@Fouziya 

Hi,

Did you find a solution for your problem ?

I have exactly the same problem to solve. I need to define RequestAcces on the Owner Group, not on a specific email...

Eric.

@Stephen Rice any update on public property Microsoft.SharePoint.Client.Web.UseAccessRequestDefault being able to email site Owners group (and not set an individual email)?

 

Many thanks.

Has this ever been addressed @Stephen Rice????  

I never saw it addressed on this thread, but this is the fix that I've been doing for a couple years now. https://sharepointviews.com/sharepoint-site-default-access-groups/

Once you reset the Permissions groups, then you can go to the Access Request settings and it will be updated to show as the group to select (and adjust if it doesn't do it automatically)