Use the Measure-M365UserDrives cmdlet to summarize the contents of multiple Microsoft 365 user drives.
Measure-M365UserDrives
[-ShowPrereqs]
[<CommonParameters>]
Measure-M365UserDrives
-Csv <String>
[-SourceFolder <String>]
[-IncludePattern <String>]
[-ExcludePattern <String>]
[-MaxAge <String>]
[-MinAge <String>]
[-ByFolder]
[-NoCache]
[-Verbosity <String>]
[<CommonParameters>]
Use this cmdlet to summarize the contents of a list of user drives.
See the Examples section for cmdlet requirements.
Description
This example summarizes the contents of user drives.
Provider configuration
| Provider | Direction | APIs | Scopes |
|---|---|---|---|
| Microsoft 365 | Source | Microsoft Graph | Files.Read.All |
CSV format
| SourceId |
|---|
TMCTools
@{
Source = @{
M365Tenant = '<TENANT_ID>'
M365ClientId = '<CLIENT_ID>'
M365ClientSecret = '<CLIENT_SECRET>'
}
Target = @{}
}
Measure-M365UserDrives -Csv 'user_drives.csv'
By default, the summary is for the entire drive. Use -ByFolder to generate a per-folder summary.
Type: SwitchParameter
Parameter Sets: Action
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The path to a CSV file containing drives to process. See the examples for the required CSV format.
Type: String
Parameter Sets: Action
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A matching pattern to determine which folders and files to exclude. Syntax details can be found here.
Type: String
Parameter Sets: Action
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A matching pattern to determine which folders and files to include. Syntax details can be found here.
Type: String
Parameter Sets: Action
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The maximum age (modified time) of files to include. Syntax details can be found here.
Type: String
Parameter Sets: Action
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The minimum age (modified time) of files to include. Syntax details can be found here.
Type: String
Parameter Sets: Action
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Refresh tokens obtained from a prior authentication will be used by default. If you are running different tools that require different permissions or want to log in as a different user, use the -NoCache option to bypass an existing refresh token.
Type: SwitchParameter
Parameter Sets: Action
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Prints the cmdlet prerequisites.
Type: SwitchParameter
Parameter Sets: Help
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Restrict the source-side listing to the specified folder.
Note that this parameter is a global option that applies to all drives listed in the CSV file.
This parameter has no effect if the SourceFolder CSV field is set.
Type: String
Parameter Sets: Action
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The amount of detail logged during processing.
Type: String
Parameter Sets: Action
Aliases:
Accepted values: None, Normal, Detailed, Diagnostic
Required: False
Position: Named
Default value: Detailed
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Required config.psd1 keys
These configuration keys are scoped to the Source node in config.psd1.
M365ClientId: The client ID of your tenant’s app.
M365ClientSecret: The client secret of your tenant’s app.
M365Tenant: The ID of your tenant. For example, source.org.
Optional config.psd1 keys
These configuration keys are scoped to the Source node in config.psd1.
M365CloudEnvironment: The cloud environment for your tenant. Allowed values are Global, China (.cn),
Germany (.de) and USGovernment (.us).
Default: Global
Required APIs
M365:
Microsoft GraphRequired scopes
M365 Graph Application:
Files.Read.AllCSV format
The Examples section shows the required fields. The following fields are optional:
SourceDisplayNameSourceFolder