Skip to content

Commit 725e63b

Browse files
authored
Merge branch 'master' into patch-355
2 parents 3c1ffcf + f4499c7 commit 725e63b

File tree

1 file changed

+87
-79
lines changed

1 file changed

+87
-79
lines changed

teams/teams-ps/teams/Connect-MicrosoftTeams.md

Lines changed: 87 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -11,73 +11,122 @@ ms.reviewer:
1111

1212
## SYNOPSIS
1313

14-
The Connect-MicrosoftTeams cmdlet connects an authenticated account to use for Microsoft Teams cmdlet requests.
15-
You can use this authenticated account only with Microsoft Teams cmdlets.
14+
The Connect-MicrosoftTeams cmdlet connects an authenticated account for use with cmdlets from the MicrosoftTeams module.
1615

1716
## SYNTAX
1817

1918
### UserCredential (Default)
2019
```
21-
Connect-MicrosoftTeams [-TenantId <String>] [-Credential <PSCredential>] [-AccountId <String>]
22-
[-LogLevel <LogLevel>] [-LogFilePath <String>] [-TeamsEnvironmentName <String>] [-WhatIf] [-Confirm]
23-
[<CommonParameters>]
20+
Connect-MicrosoftTeams
21+
[-TenantId <String>]
22+
[-Credential <PSCredential>]
23+
[-AccountId <String>]
24+
[-LogLevel <LogLevel>]
25+
[-LogFilePath <String>]
26+
[-TeamsEnvironmentName <String>]
27+
[-WhatIf]
28+
[-Confirm]
29+
[<CommonParameters>]
2430
```
2531

26-
### ServicePrincipalCertificate
32+
### AccessTokens
2733
```
28-
Connect-MicrosoftTeams -TenantId <String> -CertificateThumbprint <String> -ApplicationId <String>
29-
[-LogLevel <LogLevel>] [-LogFilePath <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
30-
```
31-
32-
### AccessToken
33-
```
34-
Connect-MicrosoftTeams [-TenantId <String>] -AadAccessToken <String> [-MsAccessToken <String>]
35-
[-ConfigAccessToken <String>] -AccountId <String> [-LogLevel <LogLevel>] [-LogFilePath <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
36-
```
37-
38-
### ManagedServiceLogin
39-
```
40-
Connect-MicrosoftTeams [-TenantId <String>] [-AccountId <String>] [-Identity] [-ManagedServicePort <Int32>]
41-
[-ManagedServiceHostName <String>] [-ManagedServiceSecret <SecureString>] [-LogLevel <LogLevel>]
42-
[-LogFilePath <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
34+
Connect-MicrosoftTeams
35+
[-TenantId <String>]
36+
-AccessTokens <String[]>
37+
-AccountId <String>
38+
[-LogLevel <LogLevel>]
39+
[-LogFilePath <String>]
40+
[-WhatIf]
41+
[-Confirm]
42+
[<CommonParameters>]
4343
```
4444

4545
## DESCRIPTION
46+
The Connect-MicrosoftTeams cmdlet connects to Microsoft Teams with an authenticated account for use with cmdlets from the MicrosoftTeams PowerShell module. After executing this cmdlet, you can disconnect from MicrosoftTeams account using Disconnect-MicrosoftTeams.
4647

4748
## EXAMPLES
4849

49-
### Example 1
50+
### Example 1: Connect to MicrosoftTeams
51+
This example connects to an Azure account. You must provide a Microsoft account or organizational ID credentials. If multi-factor authentication is enabled for your credentials, you must log in using the interactive option.
52+
5053
```powershell
51-
PS C:\> Connect-MicrosoftTeams
54+
Connect-MicrosoftTeams
55+
Account Environment Tenant TenantId
56+
------- ----------- ------------------------------------ ------------------------------------
57+
[email protected] AzureCloud xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
5258
```
5359

54-
Prompts for user credentials to connect and manage a Microsoft Teams environment.
60+
### Example 2: Connect to MicrosoftTeams
61+
The first command prompts for user credentials and stores them in the $Credential variable. The second command connects to an Azure account using the credentials stored in $credential. This account authenticates with Azure using organizational ID credentials.
5562

56-
### Example 2
5763
```powershell
58-
PS C:\> Connect-MicrosoftTeams -TeamsEnvironmentName TeamsGCCH
64+
$credential = Get-Credential
65+
Connect-MicrosoftTeams -Credential $credential
66+
Account Environment Tenant TenantId
67+
------- ----------- ------------------------------------ ------------------------------------
68+
[email protected] AzureCloud xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
5969
```
6070

61-
Specifies that the organization being managed is in the Teams GCC High environment, so connect to that environment.
71+
### Example 3: Connect to MicrosoftTeams in a specific environment
72+
This example connects to an Azure account in a specific environment. You must provide a Microsoft account or organizational ID credentials. If multi-factor authentication is enabled for your credentials, you must log in using the interactive option.
6273

63-
### Example 3
6474
```powershell
65-
PS C:\> Connect-MicrosoftTeams -TenantId c3eac90d-eb4b-48ef-ac86-7acac472d3cd -CertificateThumbprint 9b6ac64bfb8b48dbb53cca75fb33ce2d -applicationid daaaf729-aaff-45ba-8055-a39dd618fe24
75+
Connect-MicrosoftTeams -TeamsEnvironmentName TeamsGCCH
76+
Account Environment Tenant TenantId
77+
------- ----------- ------------------------------------ ------------------------------------
78+
[email protected] TeamsGCCH xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
6679
```
6780

68-
Connects to Microsoft Teams PowerShell using a Certificate and an applicationId.
81+
### Example 4: Connect to MicrosoftTeams using Accesstokens
82+
This example demonstrates how to sign in using AccessTokens. Admin can reterive Access Tokens. It requires two tokens, MS Graph Access Token and Teams Resource token.
6983

70-
### Example 4
7184
```powershell
72-
PS C:\> Connect-MicrosoftTeams -AadAccessToken c3eac90deb4b48efac867acac472d3cd -AccountId [email protected]
73-
```
85+
$graphtoken = #Get MSGraph Token for following for resource "https://graph.microsoft.com" and scopes "AppCatalog.ReadWrite.All", "Group.ReadWrite.All", "User.Read.All";
86+
$teamstoken = #Get Teams resource token for resource id "48ac35b8-9aa8-4d74-927d-1f4a14a0b239" and scope "user_impersonation";
87+
88+
Connect-MicrosoftTeams -AccessTokens @($graphtoken, $teamstoken) -AccountId $adminaccount
7489
75-
Connects to Microsoft Teams PowerShell using an Azure Active Directory Graph access token.
90+
Account Environment Tenant TenantId
91+
------- ----------- ------------------------------------ ------------------------------------
92+
[email protected] AzureCloud xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
93+
```
7694

7795
## PARAMETERS
7896

79-
### -AadAccessToken
97+
### AccessTokens
98+
Specifies a access tokens for "MSGraph" and "Skype and Teams Tenant Admin API" resources. This new parameter is added in version 2.3.2-preview.
99+
100+
Following steps must be performed by Tenant Admin in the Azure portal when using your own application.
101+
102+
Steps to configure the AAD application.
103+
1. Go to Azure portal and go to App Registrations.
104+
2. Create or select the existing application.
105+
3. Add the following permission to this Application.
106+
4. Click API permissions.
107+
5. Click Add a permission.
108+
6. Click on the Microsoft MS Graph, and then select Delegated Permission.
109+
7. Add the following permissions: "AppCatalog.ReadWrite.All", "Group.ReadWrite.All", "User.Read.All";
110+
8. Next, we need to add "Skype and Teams Tenant Admin API" resource permission. Click Add a permission.
111+
9. Navigate to "APIs my organization uses"
112+
10. Search for "Skype and Teams Tenant Admin API".
113+
11. Add all the listed permissions.
114+
12. Grant admin consent to both MS Graph and "Skype and Teams Tenant Admin API" name.
115+
116+
```yaml
117+
Type: String[]
118+
Parameter Sets: AccessTokens
119+
Aliases:
120+
Required: True
121+
Position: Named
122+
Default value: None
123+
Accept wildcard characters: False
124+
```
125+
126+
### -AadAccessToken (Removed in version 2.3.2-preview)
80127
Specifies a Azure Active Directory Graph access token.
128+
> [!WARNING]
129+
>This parameter has been removed in version 2.3.2-preview.
81130
82131
```yaml
83132
Type: String
@@ -99,7 +148,6 @@ You must specify the UPN of the user when authenticating with a user access toke
99148
Type: String
100149
Parameter Sets: UserCredential
101150
Aliases:
102-
103151
Required: False
104152
Position: Named
105153
Default value: None
@@ -111,7 +159,6 @@ Accept wildcard characters: False
111159
Type: String
112160
Parameter Sets: AccessToken
113161
Aliases:
114-
115162
Required: True
116163
Position: Named
117164
Default value: None
@@ -126,7 +173,6 @@ Specifies the application ID of the service principal.
126173
Type: String
127174
Parameter Sets: ServicePrincipalCertificate
128175
Aliases:
129-
130176
Required: True
131177
Position: Named
132178
Default value: None
@@ -141,7 +187,6 @@ Specifies the certificate thumbprint of a digital public key X.509 certificate o
141187
Type: String
142188
Parameter Sets: ServicePrincipalCertificate
143189
Aliases:
144-
145190
Required: True
146191
Position: Named
147192
Default value: None
@@ -156,7 +201,6 @@ Prompts you for confirmation before running the cmdlet.
156201
Type: SwitchParameter
157202
Parameter Sets: (All)
158203
Aliases: cf
159-
160204
Required: False
161205
Position: Named
162206
Default value: False
@@ -174,7 +218,6 @@ The PSCredential object provides the user ID and password for organizational ID
174218
Type: PSCredential
175219
Parameter Sets: UserCredential
176220
Aliases:
177-
178221
Required: False
179222
Position: Named
180223
Default value: None
@@ -190,7 +233,6 @@ Provide a value here if you need to deviate from the default PowerShell log file
190233
Type: String
191234
Parameter Sets: (All)
192235
Aliases:
193-
194236
Required: False
195237
Position: Named
196238
Default value: None
@@ -213,22 +255,22 @@ The default value is Info.
213255
Type: LogLevel
214256
Parameter Sets: (All)
215257
Aliases:
216-
217258
Required: False
218259
Position: Named
219260
Default value: None
220261
Accept pipeline input: False
221262
Accept wildcard characters: False
222263
```
223264
224-
### -MsAccessToken
265+
### -MsAccessToken (Removed in version 2.3.2-preview)
225266
Specifies a Microsoft Graph access token.
267+
> [!WARNING]
268+
>This parameter has been removed in version 2.3.2-preview.
226269
227270
```yaml
228271
Type: String
229272
Parameter Sets: AccessToken
230273
Aliases:
231-
232274
Required: False
233275
Position: Named
234276
Default value: None
@@ -247,7 +289,6 @@ You must specify the TenantId parameter to authenticate as a service principal o
247289
Type: String
248290
Parameter Sets: UserCredential, AccessToken
249291
Aliases: Domain, TenantDomain
250-
251292
Required: False
252293
Position: Named
253294
Default value: None
@@ -259,7 +300,6 @@ Accept wildcard characters: False
259300
Type: String
260301
Parameter Sets: ServicePrincipalCertificate
261302
Aliases: Domain, TenantDomain
262-
263303
Required: True
264304
Position: Named
265305
Default value: None
@@ -275,7 +315,6 @@ The cmdlet is not run.
275315
Type: SwitchParameter
276316
Parameter Sets: (All)
277317
Aliases: wi
278-
279318
Required: False
280319
Position: Named
281320
Default value: False
@@ -292,22 +331,6 @@ Specify "TeamsGCCH" if your organization is in the GCC High Environment. Specif
292331
Type: String
293332
Parameter Sets: UserCredential
294333
Aliases:
295-
296-
Required: False
297-
Position: Named
298-
Default value: None
299-
Accept pipeline input: False
300-
Accept wildcard characters: False
301-
```
302-
303-
### -ConfigAccessToken
304-
{{ Fill ConfigAccessToken Description }}
305-
306-
```yaml
307-
Type: String
308-
Parameter Sets: AccessToken
309-
Aliases:
310-
311334
Required: False
312335
Position: Named
313336
Default value: None
@@ -322,7 +345,6 @@ Login using managed service identity in the current environment.
322345
Type: SwitchParameter
323346
Parameter Sets: ManagedServiceLogin
324347
Aliases: MSI, ManagedService
325-
326348
Required: True
327349
Position: Named
328350
Default value: None
@@ -337,7 +359,6 @@ Host name for managed service login.
337359
Type: String
338360
Parameter Sets: ManagedServiceLogin
339361
Aliases:
340-
341362
Required: False
342363
Position: Named
343364
Default value: None
@@ -352,7 +373,6 @@ Port number for managed service login.
352373
Type: Int32
353374
Parameter Sets: ManagedServiceLogin
354375
Aliases:
355-
356376
Required: False
357377
Position: Named
358378
Default value: None
@@ -367,7 +387,6 @@ Secret, used for some kinds of managed service login.
367387
Type: SecureString
368388
Parameter Sets: ManagedServiceLogin
369389
Aliases:
370-
371390
Required: False
372391
Position: Named
373392
Default value: None
@@ -385,16 +404,5 @@ For more information, see about_CommonParameters (https://go.microsoft.com/fwlin
385404
## OUTPUTS
386405
387406
## NOTES
388-
Tips for troubleshooting:
389-
390-
**1. Confirm SAML 2.0 is being used.**\
391-
IDP is outputting invalid SAML information.
392-
Needs to have SAML 2.0 vs.
393-
SAML 1.0 for the module to connect.
394-
You might experience an error if the Identity Provider (IDP) only allows the use of SAML 1.0 when trying to auth via basic authentication.
395-
Which in turn, isn't expected to work because the cmdlet expects either OAUTH2 (which is used when doing just connect-microsofteams), or SAML 2.0.
396-
397-
**2. Confirm you have the latest version of the cmdlet.**\
398-
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. For more information and how to download the module, see [Teams PowerShell Overview](https://docs.microsoft.com/microsoftteams/teams-powershell-overview)
399407
400408
## RELATED LINKS

0 commit comments

Comments
 (0)