Menu

OneDrive for Business with PowerShell 7: Leavers, Sharing and Pre-Provisioning
📰

OneDrive for Business with PowerShell 7: Leavers, Sharing and Pre-Provisioning

DEV Community: azure·Anthony Buhnerkemper·about 12 hours ago
#3c46LypF
#devtoazure#devto#dev#toolkit#powershell
Reading 0:00
15s threshold

I have worked in IT for about 20 years. A lot of that was MSP operations. Today I work as an M365 cloud admin.

I kept writing the same scripts. So I cleaned them up and shared them on GitHub. This toolkit is for OneDrive for Business admins. It uses the SPO module and Microsoft Graph with PowerShell 7.

Repo: onedrive-powershell-toolkit

The problem it solves

When someone leaves, their manager often needs their files. Doing that by hand is fiddly.

Users also share files with "anyone" links and forget about them.

And before a migration, new users may not have a OneDrive yet. These scripts handle all three.

Highlight scripts

Grant-DepartedUserOneDriveAccess.ps1

Gives a manager access to a leaver's OneDrive as a secondary admin. A matching script removes that access later.

. / Grant - DepartedUserOneDriveAccess . ps1 - DepartedUser former . user @ contoso . com - Delegate manager @ contoso .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.