Logo

Documentation home for Transend tools

Update-M365Groups

SYNOPSIS

Updates groups in a Microsoft 365 tenant.

SYNTAX

Action

Update-M365Groups -ConfigNode <String> -Csv <String> [-TranslationCsv <String>] [-IgnoreErrors]
 [-SkipValidation] [-ValidateOnly] [<CommonParameters>]

Help

Update-M365Groups [-ShowPrereqs] [<CommonParameters>]

DESCRIPTION

Use the Update-M365Groups cmdlet to update groups in a Microsoft 365 tenant.

EXAMPLES

Example 1: Validation only

Description

This example validates all data for the groups in the groups.csv file but does not perform the update. This is a recommended first step so any warnings can be addressed prior to update.

Tenant configuration

Tenant Direction APIs Scopes
Microsoft 365 Target Microsoft Graph Directory.Read.All, Directory.ReadWrite.All

TMCTools

@{
  Target = @{
    M365ClientId     = '11111111-2222-3333-4444-555555555555'
    M365ClientSecret = 'abcDeFghij1lMn23OpQrStUVwx4YzAbCD5EfghIJkLM='
    M365Tenant       = 'target.org'
  }
}

Update-M365Groups -ConfigNode Target -Csv 'groups.csv' -ValidateOnly

Example 2: Basic update

Description

This example updates all groups from the groups.csv file, validating all data prior to update.

Tenant configuration

Tenant Direction APIs Scopes
Microsoft 365 Target Microsoft Graph Directory.Read.All, Directory.ReadWrite.All

TMCTools

@{
  Target = @{
    M365ClientId     = '11111111-2222-3333-4444-555555555555'
    M365ClientSecret = 'abcDeFghij1lMn23OpQrStUVwx4YzAbCD5EfghIJkLM='
    M365Tenant       = 'target.org'
  }
}

Update-M365Groups -ConfigNode Target -Csv 'groups.csv'

Example 3: Advanced update with translation

Description

This example updates all groups from the groups.csv file, validating all data prior to update. 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, Directory.ReadWrite.All

TMCTools

@{
  Target = @{
    M365ClientId     = '11111111-2222-3333-4444-555555555555'
    M365ClientSecret = 'abcDeFghij1lMn23OpQrStUVwx4YzAbCD5EfghIJkLM='
    M365Tenant       = 'target.org'
  }
}

Update-M365Groups -ConfigNode Target -Csv 'groups.csv' -TranslationCsv 'translations.csv'

PARAMETERS

-ConfigNode

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

-Csv

The path to a CSV file containing groups to update.

Type: String
Parameter Sets: Action
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-IgnoreErrors

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

-ShowPrereqs

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

-SkipValidation

Skips the property validation stage of the update.

Type: SwitchParameter
Parameter Sets: Action
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-TranslationCsv

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:

  • Identity
  • EmailAddress
  • EmailAliasesToAdd
  • EmailAliasesToRemove
  • ExternalMembersToAdd
  • InternalMembersToAdd
  • InternalOwnersToAdd
Type: String
Parameter Sets: Action
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ValidateOnly

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

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Void

NOTES

  • This cmdlet requires the ExchangeOnlineManagement PowerShell module. Install it by running Install-Module ExchangeOnlineManagement -Scope CurrentUser.

Required CSV format

*InScope *Identity EmailAddress #EmailAliasesToAdd #EmailAliasesToRemove #ExternalMembersToAdd #InternalMembersToAdd #InternalOwnersToAdd
Yes Distribution Group 1 group1_updated@example.org group1_updated@alias.org group1@alias.org member@external.org member@example.org owner@example.org
Yes DistributionSecurity Group 2 group2_updated@example.org group2_updated@alias.org group2@alias.org member@external.org member@example.org owner@example.org
Yes Security Group 3         member@example.org owner@example.org
Yes Unified Group 4 group4_updated@example.org group4_updated@alias.org group4@alias.org   member@example.org owner@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.

  • Multivalue fields are prefixed with a number sign (#) in the example table for emphasis. Do not include the number sign in the CSV file. Multiple values in a multivalue field should be separated by commas. For example, value1,value2....

TMCTools configuration options