Exports all organizational licenses from a Microsoft 365 tenant.
Export-M365OrgLicenses -ConfigNode <String> [-Format <String>] [<CommonParameters>]
Export-M365OrgLicenses [-ShowPrereqs] [<CommonParameters>]
Use the Export-M365OrgLicenses
cmdlet to export all organizational licenses
from a Microsoft 365 tenant.
Description
This example exports all organizational licenses from a Microsoft 365 tenant.
The exported data is formatted as CSV
and saved to the file org_licenses.csv
.
Tenant configuration
Tenant | Direction | APIs | Scopes (Application) |
---|---|---|---|
Microsoft 365 | Source | Microsoft Graph | Directory.Read.All |
TMCTools
@{
Source = @{
M365ClientId = '11111111-2222-3333-4444-555555555555'
M365ClientSecret = 'abcDeFghij1lMn23OpQrStUVwx4YzAbCD5EfghIJkLM='
M365Tenant = 'source.org'
}
}
Export-M365OrgLicenses -ConfigNode Source -Format Csv >'org_licenses.csv'
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 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
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
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Additional TMCTools.psd1
configurations may be required for some environments.
M365CloudEnvironment
to configure the cloud environment for token exchange.
Available options are Worldwide
(default), Germany
, and USGovernment
.