I was recently asked by a customer to assist them analyse their OneDrive for Business adoption, it's simple enough to see how many OD4B sites that have been provisioned using the "One Drive for Business sites deployed" report which is available via Office 365 Admin Center > Reports. However, just because a user has a OD4B site it doesn't necessarily mean that they are using it!
I create a PowerShell script (what else!) to collect data from each OD4B site to facilitate usage analysis, this outputs the following information for each OD4B site to a CSV file named OD4BUsage.csv that get's created on the desktop of the user who executes the script.
- Size (MB)
- Total number of files
- Oldest file date (to determine when the OD4B site became "active")
- Newest file date (to see when content was last created in the OD4B site)
The user executing the script requires Office 365 Global/SharePoint Administrator permissions and Site Collection Admin permissions to each OD4B site.
I created a second script to facilitate adding these permissions for a named user, which can be found here – https://github.com/brendankarl/Office-365-PowerShell/blob/master/Analysis/OD4B-AddPermissions.ps1 simply update the $UserToAdd variable and execute.
An alternative option is to add a user/group as a My Site Secondary Admin within the SharePoint Admin Center > User Profiles > Setup My Sites. A big thanks to my colleague Dima Chernov for letting me know about this
One thing to note is that this only applies to new OD4B sites that are created, therefore unless you configure this on day one the assigned user/group will not have access to all OD4B sites – only new one that have been created. You may need to use a combination of the two approaches:
- Execute the OD4B-AddPermissions Script – to assign permissions to existing OD4B sites
- Configure a My Site Secondary Admin – to ensure that new OD4B sites allow access to the designated user/group
Once the permissions are in place, you can then execute the script to collect the data – https://github.com/brendankarl/Office-365-PowerShell/blob/master/Analysis/OD4B-Usage-Extraction.ps1. It will prompt for credentials and the name of the tenant.
You may now be thinking great, I have a CSV file with a bunch of information – what next! In my case I used Power BI Desktop to analyse the data and put together the reports below:
One thing to point out is that the data collection script isn't very performant therefore it isn't suitable for larger tenants – 10k+ users, unless you don't mind waiting a few days for the script to complete!
Brendan Griffin – @brendankarl