< Back

Connect-MicrosoftTeams

Sat Jan 18, 2020 4:16 pm

NAME Connect-MicrosoftTeams



SYNOPSIS

The Connect-MicrosoftTeams cmdlet connects an authenticated account to use for Microsoft Teams cmdlet requests.

You can use this authenticated account only with Microsoft Teams cmdlets.





SYNTAX

Connect-MicrosoftTeams -AadAccessToken <String> -AccountId <String> [-Confirm] [-LogFilePath <String>] [-LogLevel

<LogLevel>] [-MsAccessToken <String>] [-TenantId <String>] [-WhatIf] [<CommonParameters>]



Connect-MicrosoftTeams [-AccountId <String>] [-Confirm] [-Credential <PSCredential>] [-LogFilePath <String>]

[-LogLevel <LogLevel>] [-TenantId <String>] [-WhatIf] [-TeamsEnvironmentName <String>] [<CommonParameters>]



Connect-MicrosoftTeams -ApplicationId <String> -CertificateThumbprint <String> [-Confirm] [-LogFilePath <String>]

[-LogLevel <LogLevel>] -TenantId <String> [-WhatIf] [<CommonParameters>]





DESCRIPTION







PARAMETERS

-AadAccessToken <String>

Specifies a Azure Active Directory Graph access token.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AccountId <String>

Specifies the ID of an account. You must specify the UPN of the user when authenticating with a user access

token.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ApplicationId <String>

Specifies the application ID of the service principal.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-CertificateThumbprint <String>

Specifies the certificate thumbprint of a digital public key X.509 certificate of a user account that has

permission to perform this action.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Credential <PSCredential>

Specifies a PSCredential object. For more information about the PSCredential object, type Get-Help

Get-Credential.



The PSCredential object provides the user ID and password for organizational ID credentials.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LogFilePath <String>

The path where the log file for this PowerShell session is written to. Provide a value here if you need to

deviate from the default PowerShell log file location.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LogLevel <LogLevel>

Specifies the log level. The acceptable values for this parameter are:



- Info



- Error



- Warning



- None





The default value is Info.





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-MsAccessToken <String>

Specifies a Microsoft Graph access token.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-TenantId <String>

Specifies the ID of a tenant.



If you do not specify this parameter, the account is authenticated with the home tenant.



You must specify the TenantId parameter to authenticate as a service principal or when using Microsoft account.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-TeamsEnvironmentName <String>

Use this setting if your organization is in one of the Teams Government Cloud environments.



Specify "TeamsGCCH" if your organization is in the GCC High Environment. Specify "TeamsDOD" if your

organization is in the DoD Environment.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tips for troubleshooting: 1. Confirm SAML 2.0 is being used. IDP is outputting invalid SAML information.

Needs to have SAML 2.0 vs. SAML 1.0 for the module to connect. You might experience an error if the Identity

Provider (IDP) only allows the use of SAML1.0 when trying to auth via basic authentication. Which in turn,

isn't expected to work because the cmdlet expects either OAUTH2 (which is used when doing just

connect-microsofteams), or SAML2.0. 2. Confirm you have the latest version of the cmdlet. You can find the

version by running: `get-module -listavailable` and then looking for the MicrosoftTeams name and the version

to the left of it.



-------------------------- Example 1 --------------------------



PS C:\\> Connect-MicrosoftTeams -TeamsEnvironmentName TeamsGCCH



Specifies that the organization being managed is in the Teams GCC High environment, so connect to that environment.



RELATED LINKS