Disabling OneDrive Access and Removing Data for Specific Users via PowerShell

Muhammad Faraz Imran 0 Reputation points
2024-11-02T09:58:12.0833333+00:00

I would like to explore options for deleting specific users' OneDrive data using a PowerShell script. I have around 1500+ active users with OneDrive access, and I want to disable OneDrive access for around 500+ specific users and remove the files from their OneDrive.

Is there a way to disable OneDrive access for these specific users and remove the data from their OneDrive?

I am the Global Administrator of the tenant.

OneDrive Management
OneDrive Management
OneDrive: A Microsoft file hosting and synchronization service.Management: The act or process of organizing, handling, directing or controlling something.
1,269 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,577 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.