Forum Discussion
AB21805
Jul 03, 2024Bronze Contributor
Using powershell to create folders within users onedrive
Hi all,
I'm experiencing several issues with different PowerShell versions when trying to create folders in OneDrive for users in bulk.
PowerShell 5.1 does not recognize Connect-PnPOnline.
PowerShell 7 does not recognize Connect-SPOService.
I have been following the instructions from this guide, which worked on my previous device. However, I’m unable to get it to work on my new device.
My goal is to create folders within specific users' OneDrive accounts. Could you please assist me in resolving this?
Thank you!
- Could you try this approach? https://learn.microsoft.com/en-us/answers/questions/995742/bulk-create-multiple-folders-in-onedrive-accounts? Install module first using https://www.sharepointdiary.com/2021/02/how-to-install-pnp-powershell-module-for-sharepoint-online.html#h-how-to-install-the-pnp-powershell-module-step-by-step
- AB21805Bronze Contributor
Thanks but the link you provided shows how to create folders within a specifc sharepoint list, my end goal is to create folders within multiple users onedrives.
- Sorry, my bad... Wrong link... But something like this, I guess, https://learn.microsoft.com/en-us/answers/questions/853168/bulk-create-folder-in-onedrive-accounts-using-powe, should work. The most important is to install the pnp.powershell module. You can use that in PS7 too, but I remember that in the past I had to use Import-Module -Name pnp.powershell -UseWindowsPowerShell