Skip to content

Easily create SharePoint folder shortcuts in users' OneDrive using PowerShell and Microsoft Graph API. Includes OneDrive provisioning support.

License

Notifications You must be signed in to change notification settings

craeckor/Sharepoint-Shortcut-Generator

Repository files navigation

SharePoint Shortcut Generator

This project simplifies the process of creating shortcuts to individual SharePoint sites and folders for specific users. It allows you to select users, sites, and specific folders within those sites, and then creates shortcuts in each user's OneDrive. The script checks if the user has permission to access the site and whether a shortcut already exists. Note that the Microsoft Graph API does not provide a list of existing shortcuts, and this project does not implement a search function for them. If a shortcut already exists, a warning is displayed and the script continues with the remaining items.

Additionally, new users with valid licenses do not have their OneDrive provisioned automatically. You must either log in with the account or provision OneDrive manually. For this purpose, we have included a script called OneDrive-Provisioning.ps1. With this script, you can select the users you want to provision, and it will provision OneDrive for all selected users.

Requirements

  • PowerShell 7 (will be installed if not available)
  • WebView2 (will be installed if not available)
  • A working tenant
  • OneDrive/SharePoint license for users
  • Entra application with correct redirect URI and API permissions

Usage

You can run the Sharepoint-Shortcut-Generator script as follows:

# Without Verbose
.\Sharepoint-Shortcut-Generator.ps1 -tenantId 'your-tenant-id' -clientId 'your-client-id'

# With Verbose
.\Sharepoint-Shortcut-Generator.ps1 -tenantId 'your-tenant-id' -clientId 'your-client-id' -Verbose

The same usage applies to the OneDrive-Provisioning script:

# Without Verbose
.\OneDrive-Provisioning.ps1 -tenantId 'your-tenant-id' -clientId 'your-client-id'

# With Verbose
.\OneDrive-Provisioning.ps1 -tenantId 'your-tenant-id' -clientId 'your-client-id' -Verbose

About

Easily create SharePoint folder shortcuts in users' OneDrive using PowerShell and Microsoft Graph API. Includes OneDrive provisioning support.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published