Commands › Microsoft Teams
Set-TeamsEnvironmentConfig
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)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.