Logo

Documentation home for Transend tools

Export-M365Groups

SYNOPSIS

Exports all groups from a Microsoft 365 tenant.

SYNTAX

Action

Export-M365Groups -ConfigNode <String> [-Target <String>] [-Format <String>] [<CommonParameters>]

Help

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

DESCRIPTION

Use the Export-M365Groups cmdlet to export all groups from a Microsoft 365 tenant.

EXAMPLES

Example 1: Translate for import into Google Workspace

Description

This example exports all groups from a Microsoft 365 tenant. The exported data is formatted as CSV, translated for import into Google Workspace, and saved to the file groups.csv.

Tenant configuration

Tenant Direction APIs Scopes
Microsoft 365 Source Microsoft Graph Directory.Read.All

TMCTools

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

Export-M365Groups -ConfigNode Source -Target Google -Format Csv >'groups.csv'

Example 2: Translate for import into Microsoft 365

Description

This example exports all groups from a Microsoft 365 tenant. The exported data is formatted as CSV, translated for import into Microsoft 365, and saved to the file groups.csv.

Tenant configuration

Tenant Direction APIs Scopes
Microsoft 365 Source Microsoft Graph Directory.Read.All

TMCTools

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

Export-M365Groups -ConfigNode Source -Target M365 -Format Csv >'groups.csv'

Example 3: Translate for import into GroupWise

Description

This example exports all groups from a Microsoft 365 tenant. The exported data is formatted as CSV, translated for import into GroupWise, and saved to the file groups.csv.

Tenant configuration

Tenant Direction APIs Scopes
Microsoft 365 Source Microsoft Graph Directory.Read.All

TMCTools

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

Export-M365Groups -ConfigNode Source -Target GroupWise -Format Csv >'groups.csv'

Example 4: No translation

Description

This example exports all groups from a Microsoft 365 tenant. The exported data is formatted as CSV and saved to the file groups.csv.

Note that in this example, no translation is applied, which can be useful for inspecting the raw state of data in the source tenant.

Tenant configuration

Tenant Direction APIs Scopes
Microsoft 365 Source Microsoft Graph Directory.Read.All

TMCTools

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

Export-M365Groups -ConfigNode Source -Format Csv >'groups.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

-Format

The output type for exported data.

Note that extended properties cannot be serialized into CSV format. When using -Format Csv, extended properties will display as System.Collections.Hashtable in the output.

Type: String
Parameter Sets: Action
Aliases:
Accepted values: Csv, Json, Objects

Required: False
Position: Named
Default value: Objects
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

-Target

Specifies a translation target for the exported data. Exported data translated for a supported target is directly consumable by a corresponding import cmdlet.

To export untranslated data, use -Target None.

Type: String
Parameter Sets: Action
Aliases:
Accepted values: Google, GroupWise, M365, None

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.Object[]

NOTES

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

  • Additional TMCTools.psd1 configurations may be required for some environments.

    • Use M365CloudEnvironment to configure the cloud environment for token exchange. Available options are Worldwide (default), Germany, and USGovernment.

TMCTools configuration options