Skip to content

Latest commit

 

History

History
87 lines (58 loc) · 2.98 KB

USAGE.md

File metadata and controls

87 lines (58 loc) · 2.98 KB

USAGE

Table of Contents


Module Documentation

Documentation for all public commands for the module can be viewed:

Get-Help -Full <commandName>

Prerequisites

To use this module you need to create an Azure AD application. Once you have created the application you will need to perform the following tasks:

  • Get the Client ID (Application ID) of the application
  • Get the Tenant ID of the Azure AD environment
  • Create a Client Secret or Client Certificate for the application
  • Add the following Microsoft Graph Application Permissions to the application: Files.ReadWrite.All, Sites.ReadWrite.All, Users.Read.All
  • If you are using a Client Certificate you must have it stored on your workstation or loaded in your workstation's certificate store

Module Documentation

Examples

Connecting with a Client Secret

Connect-ODS -TenantId "00000000-0000-0000-0000-000000000000" -ClientId "00000000-0000-0000-0000-000000000000" -ClientSecret (ConvertTo-SecureString -String "000000000000000000000000000" -AsPlainText -Force)

Connecting with a Client Certificate

Connect-ODS -TenantId "00000000-0000-0000-0000-000000000000" -ClientId "00000000-0000-0000-0000-000000000000" -ClientCertificate (Get-Item -Path 'Cert:\CurrentUser\My\0000000000000000000000000000000000000000)

Disconnecting

Disconnect-ODS

Creating a new Shortcut to a Document Library

New-OneDriveShortcut -Uri "https://contoso.sharepoint.com/sites/WorkingSite" -DocumentLibrary "Working Document Library" -UserPrincipalName "[email protected]"

Creating a new Shortcut to a Document Library with a custom Name

New-OneDriveShortcut -Uri "https://contoso.sharepoint.com/sites/WorkingSite" -DocumentLibrary "Working Document Library" -UserPrincipalName "[email protected]" -ShortcutName "Working DL"

Creating a new Shortcut to a Sub-Folder in a Document Library

New-OneDriveShortcut -Uri "https://contoso.sharepoint.com/sites/WorkingSite" -DocumentLibrary "Working Document Library" -FolderPath "Working Folder" -UserPrincipalName "[email protected]"

Creating a new Shortcut to a Sub-Folder in a Document Library with a custom Name

New-OneDriveShortcut -Uri "https://contoso.sharepoint.com/sites/WorkingSite" -DocumentLibrary "Working Document Library" -FolderPath "Working Folder" -UserPrincipalName "[email protected]" -ShortcutName "Working"

Getting an existing Shortcut by Name

Get-OneDriveShortcut -ShortcutName "Working Folder" -UserPrincipalName "[email protected]"

Removing an existing Shortcut by Name

Remove-OneDriveShortcut -ShortcutName "Working Folder" -UserPrincipalName "[email protected]"