New Web Property OneNoteVersionIntervalMinutes since August 2016 CU


With the following change we introduced a new property some SharePoint administrators may find useful.

3115454               August 9, 2016, update for SharePoint Foundation 2013 (KB3115454)

http://support.microsoft.com/kb/3115454/EN-US

• You have versioning enabled on a document library. You were be unable to control how frequently a new version of an OneNote Notebook Section file will be created. This update introduces the SPWebService.OneNoteVersionIntervalMinutes (default value 60*24=1 day) property to enable administrators to control how frequently versions of OneNote Notebook sections are created.

The General:
OneNote (e.g. 2013, 2016) notebooks are having an own mechanism to create versions of pages including an own Recycle Bin. Therefore it would not make much sense to store those notebooks inside a document library with versioning enabled. As usual there are a lot of circumstances around the world, that you can find notebooks everywhere and also in versioned doclibs. In the past you had no control how often a new version of a section might be created and now it is possible.

How OneNote notebooks are stored in a doclib?

You may see:

image

The icon tells you that this is a OneNote notebook, click on it and you may see the content of the notebook in OWAS (Office Web Application Server). You can also open the notebook with your OneNote client and sync it on many and different devices.

Technically this is a folder and the content of the notebook is one step down the folder structure.

In OWAS it looks like:

image

 

And in OneNote 2016 on the client:

image

 

Now the content or files in the doclib:

image

How to navigate to this view? The answer is, that it is a bit tricky, but not a secret thing. To make it easier, create a standard folder beside the notebook. Click on it and you are one level deeper. Copy the URL into notepad.

http://contoso/sites/TeamSiteContoso/_layouts/15/start.aspx#/ContosoDocLib/Forms/AllItems.aspx?RootFolder=%2Fsites%2FTeamSiteContoso%2FContosoDocLib%2FJustFolder&FolderCTID=0x012000805BE7957100214AB39FF33236B5807C&View=%7B433440F4%2DE342%2D4F72%2D8766%2D6ACEAF2764A1%7D

We named the folder: JustFolder.

Compare the link with the next one:

http://contoso/sites/TeamSiteContoso/_layouts/15/start.aspx#/ContosoDocLib/Forms/AllItems.aspx?RootFolder=%2Fsites%2FTeamSiteContoso%2FContosoDocLib%2FMyTeamContosoNoteBook

In short, exchange the JustFolder with the name of the notebook and remove the rest of the line. Use that URL and navigate so that you can see the section files. Now you can check and manage the version history of each section file.

 

How to set and read that new property?

You may store this into OneNoteVersioning.ps1

Call it to read the value: OneNoteVersioning.ps1 –WebUrl http://contoso

Call it to read the current value and also set the value to e.g. 2880 minutes: OneNoteVersioning.ps1 –WebUrl http://contoso –SetInMinutes 2880

################################################################################################

# THIS CODE-SAMPLE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED

# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR

# FITNESS FOR A PARTICULAR PURPOSE.

#

# This sample is not supported under any Microsoft standard support program or service.

# The script is provided AS IS without warranty of any kind. Microsoft further disclaims all

# implied warranties including, without limitation, any implied warranties of merchantability

# or of fitness for a particular purpose. The entire risk arising out of the use or performance

# of the sample and documentation remains with you. In no event shall Microsoft, its authors,

# or anyone else involved in the creation, production, or delivery of the script be liable for

# any damages whatsoever (including, without limitation, damages for loss of business profits,

# business interruption, loss of business information, or other pecuniary loss) arising out of

# the use of or inability to use the sample or documentation, even if Microsoft has been advised

# of the possibility of such damages.

################################################################################################

 

##

## Using new Web Property OneNoteVersionIntervalMinutes since August 2016 CU

##

 

Param(

  [Parameter(Mandatory=$True)]

  [string]$WebUrl,

  [Parameter(Mandatory=$False)]

  [int]$SetInMinutes

)

 

Write-Host -ForegroundColor White "This script read and can set the value how often a new version for a OneNote notebook section will be created"

Write-Host -ForegroundColor Gray "This setting makes sense in case you need to store OneNote Notebooks inside DocLibs with versioning enabled"

Write-Host -ForegroundColor Yellow "For Web Application : " $WebUrl

 

# Use the URL and get the web object

$SPWeb = Get-SPWeb -Identity $WebUrl

 

# Read the value and calculate it into hours and days

$InMinutes = $SPWeb.Site.WebApplication.WebService.OneNoteVersionIntervalMinutes

$InHours = $InMinutes / 60

$InDays = $InHours /24

 

Write-Host -ForegroundColor Gray "OneNote versions are created every : " $InMinutes " Minutes or"

Write-Host -ForegroundColor Gray "OneNote versions are created every : " $InHours " hours or"

Write-Host -ForegroundColor Gray "OneNote versions are created every : " $InDays " days"

 

# The new value will be written only when it is set with the parameter SetInMinutes

if($SetInMinutes -gt 0)

{

    Write-Host -ForegroundColor Red "We will set a new Value : " $SetInMinutes " Minutes"

    $SPWeb.Site.WebApplication.WebService.OneNoteVersionIntervalMinutes = $SetInMinutes   

    $SPWeb.Update()

   

    # Read again the value and write it out

    $InMinutes = $SPWeb.Site.WebApplication.WebService.OneNoteVersionIntervalMinutes

    $InHours = $InMinutes / 60

    $InDays = $InHours /24

 

    Write-Host -ForegroundColor Gray "Read the Value again:"

    Write-Host -ForegroundColor Green "The new Value is now : " $SetInMinutes " Minutes"

    Write-Host -ForegroundColor Gray "OneNote versions are created every : " $InMinutes " Minutes or"

    Write-Host -ForegroundColor Gray "OneNote versions are created every : " $InHours " hours or"

    Write-Host -ForegroundColor Gray "OneNote versions are created every : " $InDays " days"

 

}

 

$SPWeb.Dispose()

 

Comments (0)

Skip to main content