Commands › Microsoft Teams

Set-TeamsEnvironmentConfig

Microsoft Teams MicrosoftTeams Set-*

Sets environment-specific configurations on the local machine and is used to connect to the right environment when running Connect-MicrosoftTeams.

Quick start script

# Set-TeamsEnvironmentConfig — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-TeamsEnvironmentConfig
$before | Format-List

# 3. Make the change (dry run first)
Set-TeamsEnvironmentConfig  -WhatIf
Set-TeamsEnvironmentConfig

# 4. Verify and diff
$after = Get-TeamsEnvironmentConfig
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

Set-TeamsEnvironmentConfig [-EndpointUris <Hashtable>] [-TeamsEnvironmentName <String>] [-WhatIf] [-Confirm]
 [<CommonParameters>]

Parameters (4)

ParameterTypeRequiredWhat it controls
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-EndpointUris Hashtable Provides custom endpoints.
-TeamsEnvironmentName String Provides a Teams environment to connect to, for example, Teams GCCH or Teams DoD.
-WhatIf SwitchParameter Shows what would happen if the cmdlet runs. The cmdlet is not run.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.