Logo

Documentation home for Transend tools

Export-M365OrgUnits

SYNOPSIS

Exports all organizational units from a Microsoft 365 tenant.

SYNTAX

Action

Export-M365OrgUnits -ConfigNode <String> [-Format <String>] [<CommonParameters>]

Help

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

DESCRIPTION

Use the Export-M365OrgUnits cmdlet to export all organizational units from a Microsoft 365 tenant.

EXAMPLES

Example 1

Description

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

Tenant configuration

No tenant configuration is required.

TMCTools

@{
  Source = @{}
}

Export-M365OrgUnits -ConfigNode Source -Format Csv >'org_units.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

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.

TMCTools configuration options