Imports user drives into a Microsoft 365 tenant.
Import-M365UserDrives -ConfigNode <String> -Csv <String> [-TranslationCsv <String>] [-BatchSize <Int32>]
[-IgnoreErrors] [-SkipValidation] [-ValidateOnly] [<CommonParameters>]
Import-M365UserDrives [-ShowPrereqs] [<CommonParameters>]
Use the Import-M365UserDrives
cmdlet to import user drives
into a Microsoft 365 tenant.
Description
This example validates all data for the user drives in the user_drives.csv
file but does not perform the import. This is a recommended first step so any
warnings can be addressed prior to import.
Tenant configuration
Tenant | Direction | APIs | Scopes |
---|---|---|---|
Microsoft 365 | Target | Microsoft Graph | Directory.Read.All |
TMCTools
@{
Target = @{
M365ClientId = '11111111-2222-3333-4444-555555555555'
M365ClientSecret = 'abcDeFghij1lMn23OpQrStUVwx4YzAbCD5EfghIJkLM='
M365Tenant = 'target.org'
M365SharePointUrl = 'https://target-admin.sharepoint.com'
}
}
Import-M365UserDrives -ConfigNode Target -Csv 'user_drives.csv' -ValidateOnly
Description
This example imports all user drives from the user_drives.csv
file, validating all data prior to import.
Tenant configuration
Tenant | Direction | APIs | Scopes |
---|---|---|---|
Microsoft 365 | Target | Microsoft Graph | Directory.Read.All |
TMCTools
@{
Target = @{
M365ClientId = '11111111-2222-3333-4444-555555555555'
M365ClientSecret = 'abcDeFghij1lMn23OpQrStUVwx4YzAbCD5EfghIJkLM='
M365Tenant = 'target.org'
M365SharePointUrl = 'https://target-admin.sharepoint.com'
}
}
Import-M365UserDrives -ConfigNode Target -Csv 'user_drives.csv'
Description
This example imports all user drives from the user_drives.csv
file, validating all data prior to import. Data is translated according to the
mappings provided in the translations.csv
file.
Tenant configuration
Tenant | Direction | APIs | Scopes |
---|---|---|---|
Microsoft 365 | Target | Microsoft Graph | Directory.Read.All |
TMCTools
@{
Target = @{
M365ClientId = '11111111-2222-3333-4444-555555555555'
M365ClientSecret = 'abcDeFghij1lMn23OpQrStUVwx4YzAbCD5EfghIJkLM='
M365Tenant = 'target.org'
}
}
Import-M365UserDrives -ConfigNode Target -Csv 'user_drives.csv' -TranslationCsv 'translations.csv'
The number of user drives to import per batch. If not specified, the maximum of 200 user drives is used.
Type: Int32
Parameter Sets: Action
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The TMCTools.psd1
configuration node to use.
Type: String
Parameter Sets: Action
Aliases:
Accepted values: Source, Target
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The path to a CSV file containing user drives to import.
Type: String
Parameter Sets: Action
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Validation errors stop execution prior to the import by default. Use
-IgnoreErrors
to proceed with error records omitted.
Note that global errors are not impacted by this option.
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: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Skips the property validation stage of the import.
Type: SwitchParameter
Parameter Sets: Action
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The path to the CSV file containing translation mappings. The file must use
SourceName;TargetName
as the field identifiers.
The following fields can be translated:
Type: String
Parameter Sets: Action
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Validation and import are both performed by default. Use -ValidateOnly
to
perform the validation but skip the import.
It is recommended to run a -ValidateOnly
pass first to identify potential
issues prior to importing data. Note that records with validation errors will
fail to import unless -IgnoreErrors
is used, but records with validation
warnings proceed without the data triggering the warning. A -ValidateOnly
pass
allows you to inspect these warnings before data is written and make any
necessary changes.
Type: SwitchParameter
Parameter Sets: Action
Aliases:
Required: False
Position: Named
Default value: None
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.
This cmdlet requires the ExchangeOnlineManagement PowerShell module. Install
it by running Install-Module ExchangeOnlineManagement -Scope CurrentUser
.
This cmdlet requires the Microsoft.Online.SharePoint.PowerShell PowerShell
module. Install it by running Install-Module Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser
.
Note that you must install the module using Windows PowerShell (PowerShell 5.1
or earlier) even though you need to run Import-M365UserDrives
using
PowerShell 7.0 or later.
Required CSV format
*InScope | *Identity |
---|---|
Yes | user@example.org |
CSV Notes
CSV fields should be separated by semicolons. For example,
InScope;Identity...
.
Required fields are prefixed with an asterisk (*) in the example table for emphasis. Do not include the asterisk in the CSV file.
Identity
can the user’s object ID, UPN, email address, email alias or
display name.