This week I encountered a strange feature of the SharePoint Online Admin module. I was trying to create a fresh site collection to migrate an existing site collection to, but for some reason, and without any feedback, the creation process of the new site collection seemed to fail. After trying a few times, I realized this was not working 😉
I decided to use SharePoint Online Management Shell to try and see if I would receive some feedback as to why my site collection wasn’t created. Commands to create a site collection (you have to be a tenant admin to use these):
First connect to the tenant admin module:
Connect-SPOService -URL https://yourtenant-admin.sharepoint.com
Then create the site collection using the following command:
New-SPOSite -Url https://yourtenant.sharepoint.com/sites/sitecollectionname -Owner admin@yourtenant.onmicrosoft.com -StorageQuota 100 -Title "Site collection title" -ResourceQuota 300 -NoWait
There are more switches you can use to create a site collection, like choosing the site template, etc. See the MS docs for this.
To my surprise, I got an error message telling me that the site collection I was trying to create already existed – in the recycle bin of the tenant!
Now I remembered: We had previously done a test run of the migration of the site collection and afterwards deleted it! So it was just a matter of clearing the site from the recycle bin, either through the UI of through the command that PowerShell offered me:
Remove-SPODeletedSite -Identity https://yourtenant.sharepoint.com/sites/sitecollectionname
When trying to create a new site collection now, all went well. Still a bit strange that the SharePoint admin UI didn’t offer me this feedback in the first place.
Happy site collection creation!