Applies ToOneNote cho Microsoft 365 OneNote cho web OneNote 2021 OneNote 2016

If an educator leaves a school or changes classes, it is common to transfer one or more Class Notebooks to another educator.

This script will allow IT Admin to copy and transfer Class Notebook contents from the former educator's OneDrive to the new educator's OneDrive. The script will also re-trigger the provisioning and permissive API's to ensure that any relocated Class Notebook and its content, such as its Collaboration Space, Content Library, and student notebooks, are properly set up. In addition, an email with a link to open the notebook in its new location will be sent to all the students in the class .

The following aspects of the API are covered in this sample. Obtain an access token using Azure PowerShell POST a Class Notebook Transfer

Azure PowerShell - used to obtain an access token to talk to the OneNote Class Notebooks API. Two Microsoft 365 account with OneDrive set up - This sample will transfer a notebook from one educator's OneDrive to another's.

To ensure that OneDrive is set up, log on to Microsoft 365 and select OneDrive in the App launcher App launcher button. If you are taken to OneDrive, you are all set. OneNote Class Notebook created using Microsoft's OneNote Class Notebooks API is the notebook that will be transferred between educators.

Change permissions

  1. Obtain a client ID as described under Authenticate using Azure AD (enterprise apps). When asked for a redirect URI, "http://localhost" will suffice:

  2. Download this repo as a ZIP file to your local computer and extract the files, or clone the repository into a local copy of Git.

    Add an indented paragraph under a numbered step by placing your cursor before the /para tag, then pressing Enter.

  3. Edit OneNoteClassNotebooksApiSample.ps1. Find and replace the following tokens with real values:

    <AZURE_AD_TENANT_NAME> - This is your Microsoft 365 tenant, e.g. "contoso.com".

    <CLIENT_ID> - This is the client ID of your app, e.g. "471afe29-4aee-4bc5-9aaf-468ee5bbe20a".

    <MY_ADMIN_LOGIN> - This is your IT Admin Microsoft 365 login name.

    <MY_ADMIN_PASSWORD> - This is your IT Admin Microsoft 365 password.

    <NOTEBOOK_ID> - This is the Id of the notebook to be transferred.

    <SOURCE_TEACHER_ID> - This is the login name of the original educator who owns the notebook.

    <DESTINATION_TEACHER_ID> - This is the login name of the new educator who will receive the notebook.

  4. Once all the placeholders above have been replaced with real values (remember to enclose each value in double quotes), simply execute the script.

  5. Once the script has successfully executed, you will receive a string containing the correlation number. Be sure to save the correlation number for future reference.

  6. Go to the destination educator's OneDrive and open the Class Notebooks folder. In this folder you will find the transferred Class Notebook. This process may take a few minutes.

Bạn cần thêm trợ giúp?

Bạn muốn xem các tùy chọn khác?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.