Set-TeamsEnvironmentConfig
Sets environment-specific configurations on the local machine and is used to connect to the right environment when running Connect-MicrosoftTeams.
Syntax
Default (Default)
Set-TeamsEnvironmentConfig
[-EndpointUris <Hashtable>]
[-TeamsEnvironmentName <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
This cmdlet sets environment-specific configurations like endpoint URIs(such as Microsoft Entra ID and Microsoft Graph) and Teams environment (such as GCCH and DOD) on the local machine.
When running Connect-MicrosoftTeams, environment-specific information set in this cmdlet will be considered unless overridden by Connect-MicrosoftTeams parameters.
Parameters passed to Connect-MicrosoftTeams will take precedence over the information set by this cmdlet.
Clear-TeamsEnvironmentConfig should not be used in Commercial, GCC, GCC High, or DoD environments.
Examples
Example 1
PS C:\> Set-TeamsEnvironmentConfig -TeamsEnvironmentName TeamsChina
Sets the environment as Gallatin China on a local machine and when Connect-MicrosoftTeams is run, authentication will happen in the Gallatin China cloud and Microsoft Teams module will connect to the Gallatin environment.
Example 2
$endPointUriDict = @{ActiveDirectory = 'https://login.microsoftonline.us/';MsGraphEndpointResourceId = 'https://graph.microsoft.us'}
Set-TeamsEnvironmentConfig -TeamsEnvironmentName $endPointUriDict
Sets endpoint URIs required for special clouds.
Example 3
Set-TeamsEnvironmentConfig -TeamsEnvironmentName TeamsChina
$cred=get-credential
Move-CsUser -Identity "PilarA@contoso.com" -Target "sipfed.online.lync.com" -Credential $cred
This cmdlet is mainly introduced to support Skype for Business to Microsoft Teams user migration using Move-CsUser.
This example shows how tenant admins can run Move-CsUser in Gallatin and other special clouds after setting the environment configuration using Set-TeamsEnvironmentConfig.
Note that Set-TeamsEnvironmentConfig needs to be run only once for each machine. There is no need to run it each time before running Move-CsUser.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | cf |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-EndpointUris
Provides custom endpoints.
Parameter properties
Type: | Hashtable |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-TeamsEnvironmentName
Provides a Teams environment to connect to, for example, Teams GCCH or Teams DoD.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | wi |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
None
Outputs
System.Object
Notes
Set-TeamsEnvironmentConfig should not be used in Commercial, GCC, GCC High, or DoD environments.