Robin
Robin

Reputation: 1645

Office 365 Groups - Create Default OneNote Document

We're creating Office 365 Groups using a PowerShell script, and this process in place already and we're happy with it.

I was wondering however, if it was possible to trigger the creation of the default OneNote document via the Graph API at all? It appears as though when a Group is created, it's not until someone manually visits the Document library and clicks the OneNote document, is it actually created (on the fly). I have arrived at this conclusion because if we run a Get-UnifiedGroup on the group itself (storing the result in $Group), the following property is empty: $Group.SharePointNotebookUrl

The reason we'd like to do this, is so we can create Office 365 Groups and populate the default OneNote notebook with some information, without having to have a user with permission to the group, manually trigger the creation of it. I'm able to create additional notebooks in the Group, but these are not 'presented' in the same way to end users that the default one is (with it's own dedicated tabs/menu links).

Upvotes: 3

Views: 803

Answers (2)

Maxali
Maxali

Reputation: 1972

Office 365 default Notebook is a file in SiteAssets library in the associated SharePoint site.

If Notebook is not created yet, you can create by enabling SharePoint Feature SiteNotebook with Id f151bb39-7c3b-414f-bb36-6bf18872052f

With PnP PowerShell:

Enable-PnPFeature -Identity f151bb39-7c3b-414f-bb36-6bf18872052f -Scope Web

This will create Notebook in SiteAssets library and adds PropertyBag to SPWeb with name "SiteNotebookGuid".

Upvotes: 1

Marc LaFleur
Marc LaFleur

Reputation: 33114

This isn't possible from Microsoft Graph today. As you noted, the default OneNote for a Group is created the first time you attempt to access it. It's also a little different in that it gets places in a SiteAssetts library which also doesn't exist when the group is created.

I recommend visiting the UserVoice and adding this as a suggestion.

Upvotes: 2

Related Questions