Updates users in a Microsoft 365 tenant.
Update-M365Users [-ShowPrereqs] [<CommonParameters>]
Update-M365Users -ConfigNode <String> -Csv <String> [-TranslationCsv <String>] [-IgnoreErrors]
[-SkipValidation] [-ValidateOnly] [<CommonParameters>]
Use the Update-M365Users
cmdlet to update users
in a Microsoft 365 tenant.
See the Notes section for cmdlet requirements.
Update-M365Users -ConfigNode Target -Csv 'users.csv' -ValidateOnly
This example validates all data for the users in the users.csv
file but does not perform the operation. This is a recommended first step so any
warnings can be addressed first.
Update-M365Users -ConfigNode Target -Csv 'users.csv'
This example updates all users from the users.csv
file.
Update-M365Users -ConfigNode Target -Csv 'users.csv' -TranslationCsv 'translations.csv'
This example updates all users from the users.csv
file.
Data is translated according to the mappings provided in the translations.csv
file.
The config.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 objects to update. See the Notes section for the required format.
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 update 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: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Skips the property validation stage of the import. Data supplied in the via the
-Csv
parameter will be used as-is, which may lead to runtime errors.
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.
Type: String
Parameter Sets: Action
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Validation and update are both performed by default. Use -ValidateOnly
to
perform the validation but skip the update.
It is recommended to run a -ValidateOnly
pass first to identify potential
issues prior to updating data. Note that records with validation errors will
fail to update 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.
Required PowerShell modules
ExchangeOnlineManagement
Microsoft.Online.SharePoint.PowerShell
PnP.PowerShell
Note that you must install the Microsoft.Online.SharePoint.PowerShell
module using Windows PowerShell
(PowerShell 5.1 or earlier).
Required config.psd1 configurations
M365ClientId
M365ClientSecret
M365SharePointDomain
M365Tenant
Optional config.psd1 configurations
M365ClientCertificate
M365CloudEnvironment
StageIntermissionSeconds
Required APIs
Microsoft Graph
Office 365 Exchange Online
SharePoint
Required Microsoft Graph Application scopes
Calendars.Read
Directory.Read.All
Directory.ReadWrite.All
Sites.Manage.All
Sites.Read.All
Sites.ReadWrite.All
Required Office 365 Exchange Online Application scopes
Exchange.ManageAsApp
Required SharePoint Application scopes
Sites.FullControl.All
Required CSV format
Property | Required | Multivalue | Notes |
---|---|---|---|
InScope | True | False | Allowed values: Yes , True , No and False |
Identity | True | False | Allowed values: OID, UPN, email address, email alias, display name |
LoginId | False | False | |
LicensesToAdd | False | True | Does not apply to NonMailbox |
EmailAddress | False | False | Does not apply to NonMailbox |
EmailAliasesToAdd | False | True | Does not apply to NonMailbox |
EmailAliasesToRemove | False | True | Does not apply to NonMailbox |
MailboxForwardAndStoreAddressesToAdd | False | True | Cannot be used with MailboxForwardOnlyAddressesToAdd , Does not apply to NonMailbox |
MailboxForwardAndStoreAddressesToRemove | False | True | Does not apply to NonMailbox |
MailboxForwardOnlyAddressesToAdd | False | True | Cannot be used with MailboxForwardAndStoreAddressesToAdd , Does not apply to NonMailbox |
MailboxForwardOnlyAddressessToRemove | False | True | Does not apply to NonMailbox |
MailboxFullAccessDelegatesToAdd | False | True | Does not apply to NonMailbox |
MailboxSendAsDelegatesToAdd | False | True | Does not apply to NonMailbox |
MailboxOnBehalfOfDelegatesToAdd | False | True | Does not apply to NonMailbox |
CalendarActAsDelegatesToAdd | False | True | Automatically grants MailboxOnBehalfOfDelegatesToAdd , Does not apply to NonMailbox |
CalendarLimitedActAsDelegatesToAdd | False | True | Does not apply to NonMailbox |
CalendarEditorDelegatesToAdd | False | True | Does not apply to NonMailbox |
CalendarReviewerDelegatesToAdd | False | True | Does not apply to NonMailbox |
CalendarLimitedReviewerDelegatesToAdd | False | True | Does not apply to NonMailbox |
CalendarAvailabilityDelegatesToAdd | False | True | Does not apply to NonMailbox |
CSV fields should be separated by semicolons. For example,
InScope;Identity...
.
Multivalue fields should be separated by commas. For example,
value1,value2...
.
LicensesToAdd
should contain SKUs of the licenses you want to add. SKUs can
be retrieved using Export-M365OrgLicenses
.