Manage folders anf files on users onedrive for business with powershell

Brass Contributor

HI,

I would like to check if some files and folders exists on onedrive for business for my tenant's users. what is the best way to do this in Powershell. Is is possible with sharepoint PnP?

 

Thanks

2 Replies
Yes, this should be possible using both PnP and CSOM API in PowerShell...bear in mind that you will need to be admin in the ODFB sites you want to check

If you would like to manage files and folders in OneDrive for Business for all users within tenant, then PowerShell script is good option. You can use SharePoint Add-In credentials which will have full control on all sites within Tenant and using PnP PowerShell you can connect to each user's OD4B site and perform necessary activities.