Share via

Enable OpenInClient with Graph

Anonymous
2019-10-11T09:50:52+00:00

tl;dr Can you enable SharePoint site features with Microsoft Graph?

Hi!

My main goal is to make sure OpenInClient is enabled on all SharePoint sites in my tenant (so the default behavior is to open in the desktop applications rather than web apps).

I have previously done this via a PowerShell script I've put together:

$tenant = "myTenant"

$site = "https://$tenant-admin.sharepoint.com"

$userCredentials = Get-Credential

Connect-SPOService -Url $site -Credential $userCredentials

$sites = Get-SPOSite -Limit All

ForEach($s in $sites){

Connect-PnPOnline -Url $s.Url -Credentials $userCredentials

Enable-PnPFeature -Identity 8A4B8DE2-6FD8-41e9-923C-C7C3C00F8295 -Scope Site

}

However, there are new groups created each and every day which makes it necessary for me to automate the script. Of course, the preferred option would be to set OpenInClient as default behaviour for all sites but this is not possible to my knowledge.

So, the option then is to automate this. Either I will have to make a Azure Function that runs this PowerShell-script but I would prefer to use Microsoft Graph so I can run it with LogicApps instead. So, is there a way to enable SP site features with Microsoft Graph?

Thanks!

Microsoft 365 and Office | SharePoint | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2019-10-17T19:02:50+00:00

Finally figured out a good enough solution using the SharePoint REST API.

In LogicApps (and Flow) there is a connector called "Send an HTTP request to SharePoint".

Then I'll send a POST request to the SharePoint Site with the URI set to: _api/site/features/add(8A4B8DE2-6FD8-41e9-923C-C7C3C00F8295)

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2019-10-17T17:54:00+00:00

    Thank you for your reply. Unfortunately, the MSDN Forums seems to be for everything but SharePoint Online which is what I am working with.

    Regarding the documentation for Graph I've basically read through everything without finding the answer. It is supposed to be able to reach the SPWeb object but there is no example of how one could use that to enable a site collection feature via graph.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2019-10-11T12:44:44+00:00

    Hi Niklas,

    Thanks for querying in our community.

    There’s an official article Working with SharePoint sites in Microsoft Graph for your reference. And if you need further assistance on this, you can seek help from MSDN Forums, which is the official SharePoint development community. Support engineers there would conduct in-depth research on the problem you met and can provide you with more professional help.

    Appreciate your understanding.

    Best regards,

    Madoc

    Was this answer helpful?

    0 comments No comments