OneDrive reporting

How to find inactive OneDrive accounts in Microsoft 365

List OneDrives with no recent file activity with Microsoft Graph PowerShell, export the OneDrive usage report from the Microsoft 365 admin centre, or run Altivane's OneDrive report.

By the Published

To find inactive OneDrive accounts in Microsoft 365, download the OneDrive usage report with Get-MgReportOneDriveUsageAccountDetail and keep the accounts whose Last Activity Date is old or blank. Only file activity in the OneDrive counts. The report lists only people with a valid OneDrive licence, and it names no one if your tenant conceals names in usage reports.

Choose the method that fits the job
MethodBest fit
PowerShellA CSV of OneDrives with no file activity for a set number of days, longest idle first.
Admin centreA one-off export of Microsoft's usage report, sorted by last activity in Excel.
AltivaneRecommended for regular reviews, with the days set once and each OneDrive's storage.

Before you start

Use an account that can view usage reports, such as Reports Reader or SharePoint Administrator. The PowerShell example requests Reports.Read.All; your organisation may require administrator consent.

Know how fresh it is. Microsoft says usage reports typically become available within 24 to 72 hours, so the last few days can be missing. It takes at least 7 days for a deleted account to be marked as deleted, and deleted users stay in the reports for 180 days. The examples read and export; they change no OneDrive or account.

Option 1

Find inactive OneDrive accounts with PowerShell

Install the modules once, then connect and export the OneDrives idle for more than 90 days or with no activity date.

PowerShell
# Install once, if the modules are not already installed.
Install-Module Microsoft.Graph.Authentication, Microsoft.Graph.Reports -Scope CurrentUser
PowerShell
$ErrorActionPreference = 'Stop'
$days = 90
$utc = [System.Globalization.DateTimeStyles]::AssumeUniversal -bor
    [System.Globalization.DateTimeStyles]::AdjustToUniversal
$today = (Get-Date).ToUniversalTime().Date
Connect-MgGraph -Scopes 'Reports.Read.All' -NoWelcome
try {
    $download = Join-Path $PWD 'onedrive-usage-download.csv'
    Get-MgReportOneDriveUsageAccountDetail -Period D180 -OutFile $download
    $accounts = @(Import-Csv -Path $download)
    Remove-Item -Path $download
    $report = @(foreach ($account in $accounts) {
        if ($account.'Is Deleted' -eq 'True') { continue }
        $idle = $null
        if ($account.'Last Activity Date') {
            $last = [datetime]::ParseExact($account.'Last Activity Date', 'yyyy-MM-dd',
                [System.Globalization.CultureInfo]::InvariantCulture, $utc).ToUniversalTime()
            $idle = [int]($today - $last.Date).TotalDays
        }
        if ($null -eq $idle -or $idle -gt $days) {
            [pscustomobject]@{
                Owner = $account.'Owner Display Name'
                Account = $account.'Owner Principal Name'
                LastActivity = $account.'Last Activity Date'
                DaysIdle = $idle
                StorageGB = [math]::Round([double]$account.'Storage Used (Byte)' / 1GB, 2)
                Files = [int64]$account.'File Count'
            }
        }
    })
    if ($report.Count -eq 0) {
        Write-Output "No OneDrive has been idle for more than $days days."
    } else {
        $order = @{
            Expression = { if ($null -eq $_.DaysIdle) { [int]::MaxValue } else { $_.DaysIdle } }
            Descending = $true
        }
        $report | Sort-Object $order |
            Export-Csv -Path './inactive-onedrives.csv' -NoTypeInformation -Encoding utf8
        Write-Output "$($report.Count) OneDrives are idle for more than $days days or have no date."
    }
} finally {
    Disconnect-MgGraph | Out-Null
}

The CSV has 1 row for each OneDrive: those with no activity date first, then the longest idle, with storage in gigabytes and the file count. The script leaves out OneDrives marked deleted. Raise or lower $days to widen or narrow the list. Microsoft leaves the date blank when a OneDrive has no file activity, and the date is the latest activity whatever period you ask for.

Option 2

Review OneDrive activity in the admin centre

  1. Open the Microsoft 365 admin centre for the correct tenant.
  2. Go to Reports > Usage. If Reports is missing, select Show all first.
  3. Under Reports, select OneDrive, then the Usage tab.
  4. Select Choose columns to add Last activity date (UTC) to the table if it isn't shown.
  5. Select Export to download every user's usage as a CSV file, then sort it by Last activity date (UTC) in Excel.

This suits a one-off look, and it's the same report the script downloads. It doesn't suit a regular review: each export means sorting and counting the days manually again.

Common questions

Why do the owner columns not name anyone?

Microsoft hides user, group and site names in usage reports by default, and the setting applies to Microsoft Graph too. A Global Administrator can show them in the Microsoft 365 admin centre under Settings > Org settings, the Services tab, Reports, by clearing Conceal user, group, and site names in all reports. Microsoft logs showing names in the Microsoft Purview audit log, so check your privacy rules first.

Does a person who works every day show as inactive?

They can. Last activity is the latest file activity in their OneDrive, so someone who keeps every file in team sites shows as idle. Read the date as the OneDrive being idle, not the person.

What about the accounts behind idle OneDrives?

An idle OneDrive often belongs to an account no one signs in to. To check those, see how to find inactive users in Microsoft Entra ID.

Microsoft references

Technical references checked on 7 November 2026. The example scripts have been reviewed and syntax checked; they have not been run against a live tenant.

Talk to us about Altivane

Questions, or pricing? Get in touch.

Contact us