Replies: 2 comments
-
I guess you are missing the versions. The script only gets the size of the last version from each file instead of the full size. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I find Sharepoint Diary has a lot of base scripts that you can tailor to your needs This one gets a report of all files and their actual storage size including version histories |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Folks,
I am a total newbie when it comes to scripting, a colleague left my team and was handed over his workload (Sharepoint Online)
I have mainly been using Co-Pilot to help create/troubleshoot my scripts and when I get stuck there, my company has a support agreement with Microsoft.
Currently we have a pilot of about 200 odd users, but when spot checking my results, I am getting a big difference for some users (eg what the script captures VS what's in the Storage metrics section of a users OneDrive)
Below is the code ive been using, and as this is not a MS supported library, I was hoping someone here could me figure out why we are seeing such differences in the data please
EG - user 1: Report shows 71GB in PHL vs. 325GB when checking Storage Metrics (difference of ~250GB)
user 2: Report shows 330GB in PHL vs. 961GB when checking Storage Metrics (difference of ~630GB)
SCRIPT:
`# Config Variables
$TenantAdminURL = "https://ausxxx-admin.sharepoint.com"
$ReportOutput = "C:\Temp\OneDriveUsage.csv"
$EmailListPath = "C:\Temp\Pilot5.csv" # Path to the CSV file containing email addresses
Import email addresses from CSV
$EmailList = Import-Csv -Path $EmailListPath
$UsageData = @()
Connect to Admin Center using PnP Online
Connect-PnPOnline -Url $TenantAdminURL -Interactive # Use -UseWebLogin or -Interactive as needed
Loop through each email in the list
ForEach($Email in $EmailList) {
Try {
$UserEmail = $Email.Email # Assuming the CSV has a column named 'Email'
}
Export the data to CSV Report
$UsageData | Out-GridView
$UsageData | Export-Csv -Path $ReportOutput -NoTypeInformation
`
Beta Was this translation helpful? Give feedback.
All reactions