Skip to content

Commit 7971564

Browse files
committed
Merge branch 'main' into EWSCortana-chrisda
2 parents 4ad3bbc + cd616a7 commit 7971564

File tree

1 file changed

+78
-26
lines changed

1 file changed

+78
-26
lines changed

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

Lines changed: 78 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,24 @@ Connect-MicrosoftTeams
2929
[<CommonParameters>]
3030
```
3131

32+
### ServicePrincipalCertificate
33+
```
34+
Connect-MicrosoftTeams
35+
-TenantId <String>
36+
-CertificateThumbprint <String>
37+
-ApplicationId <String>
38+
[-LogLevel <LogLevel>]
39+
[-LogFilePath <String>]
40+
[-WhatIf]
41+
[-Confirm]
42+
[<CommonParameters>]
43+
```
44+
3245
### AccessTokens
3346
```
3447
Connect-MicrosoftTeams
3548
[-TenantId <String>]
36-
-AccessTokens <String[]>
49+
-AccessTokens <String[]>
3750
[-LogLevel <LogLevel>]
3851
[-LogFilePath <String>]
3952
[-WhatIf]
@@ -79,7 +92,45 @@ Account Environment Tenant Tenan
7992
[email protected] TeamsGCCH xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
8093
```
8194

82-
### Example 4: Connect to MicrosoftTeams using Access Tokens
95+
### Example 4: Connect to MicrosoftTeams using a certificate thumbprint
96+
This example demonstrates how to authenticate using a certificate thumbprint. Application-based authentication has been reintroduced in preview with version 4.7.1-preview. For details and supported cmdlets, please see [Application-based authentication in Teams PowerShell Module](/MicrosoftTeams/teams-powershell-application-authentication).
97+
98+
```powershell
99+
Connect-MicrosoftTeams -CertificateThumbprint "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -ApplicationId "00000000-0000-0000-0000-000000000000" -TenantId "YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY"
100+
```
101+
102+
### Example 5: Connect to MicrosoftTeams using Application-based Access Tokens
103+
This example demonstrates how to authenticate with an application using Access Tokens. Access Tokens can be retrieved via the login.microsoftonline.com endpoint. It requires two Access Tokens – “MS Graph” and “Skype and Teams Tenant Admin API” resources.
104+
105+
Application-based authentication has been reintroduced in preview with version 4.7.1-preview. For details and supported cmdlets, see [Application-based authentication in Teams PowerShell Module](/MicrosoftTeams/teams-powershell-application-authentication).
106+
107+
```powershell
108+
$ClientSecret = "…"
109+
$ApplicationID = "00000000-0000-0000-0000-000000000000"
110+
$TenantID = "YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY"
111+
112+
$graphtokenBody = @{
113+
Grant_Type = "client_credentials"
114+
Scope = "https://graph.microsoft.com/.default"
115+
Client_Id = $ApplicationID
116+
Client_Secret = $ClientSecret
117+
}
118+
119+
$graphToken = Invoke-RestMethod -Uri "https://login.microsoftonline.com/$TenantID/oauth2/v2.0/token" -Method POST -Body $graphtokenBody | Select-Object -ExpandProperty Access_Token
120+
121+
$teamstokenBody = @{
122+
Grant_Type = "client_credentials"
123+
Scope = "48ac35b8-9aa8-4d74-927d-1f4a14a0b239/.default"
124+
Client_Id = $ApplicationID
125+
Client_Secret = $ClientSecret
126+
}
127+
128+
$teamsToken = Invoke-RestMethod -Uri "https://login.microsoftonline.com/$TenantID/oauth2/v2.0/token" -Method POST -Body $teamstokenBody | Select-Object -ExpandProperty Access_Token
129+
130+
Connect-MicrosoftTeams -AccessTokens @("$graphToken", "$teamsToken")
131+
```
132+
133+
### Example 6: Connect to MicrosoftTeams using Access Tokens in the delegated flow
83134
This example demonstrates how to sign in using Access Tokens. Admin can retrieve Access Tokens via the login.microsoftonline.com endpoint. It requires two tokens, MS Graph Access Token and Teams Resource token.
84135

85136
A delegated flow, such as Resource Owner Password Credentials (ROPC) or device code, must be used, with the following delegated app permissions required.
@@ -119,23 +170,25 @@ [email protected] AzureCloud xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxx
119170
## PARAMETERS
120171

121172
### AccessTokens
122-
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.
123-
124-
Following steps must be performed by Tenant Admin in the Azure portal when using your own application.
125-
126-
Steps to configure the AAD application.
127-
1. Go to Azure portal and go to App Registrations.
128-
2. Create or select the existing application.
129-
3. Add the following permission to this Application.
130-
4. Click API permissions.
131-
5. Click Add a permission.
132-
6. Click on the Microsoft MS Graph, and then select Delegated Permission.
133-
7. Add the following permissions: "AppCatalog.ReadWrite.All", "Group.ReadWrite.All", "User.Read.All";
134-
8. Next, we need to add "Skype and Teams Tenant Admin API" resource permission. Click Add a permission.
135-
9. Navigate to "APIs my organization uses"
136-
10. Search for "Skype and Teams Tenant Admin API".
137-
11. Add all the listed permissions.
138-
12. Grant admin consent to both MS Graph and "Skype and Teams Tenant Admin API" name.
173+
Specifies access tokens for "MS Graph" and "Skype and Teams Tenant Admin API" resources. Both the tokens used should be of the same type.
174+
175+
- Application-based authentication has been reintroduced in preview with version 4.7.1-preview. For details and supported cmdlets, see [Application-based authentication in Teams PowerShell Module](/MicrosoftTeams/teams-powershell-application-authentication).
176+
177+
- Delegated flow - The following steps must be performed by Tenant Admin in the Azure portal when using your own application.
178+
179+
Steps to configure the AAD application.
180+
1. Go to Azure portal and go to App Registrations.
181+
2. Create or select the existing application.
182+
3. Add the following permission to this Application.
183+
4. Click API permissions.
184+
5. Click Add a permission.
185+
6. Click on the Microsoft MS Graph, and then select Delegated Permission.
186+
7. Add the following permissions: "AppCatalog.ReadWrite.All", "Group.ReadWrite.All", "User.Read.All";
187+
8. Next, we need to add "Skype and Teams Tenant Admin API" resource permission. Click Add a permission.
188+
9. Navigate to "APIs my organization uses"
189+
10. Search for "Skype and Teams Tenant Admin API".
190+
11. Add all the listed permissions.
191+
12. Grant admin consent to both MS Graph and "Skype and Teams Tenant Admin API" name.
139192

140193
```yaml
141194
Type: String[]
@@ -179,10 +232,9 @@ Accept wildcard characters: False
179232
```
180233
181234
### -ApplicationId
182-
Specifies the application ID of the service principal.
235+
Specifies the application ID of the service principal that is used in application-based authentication.
183236
184-
> [!WARNING]
185-
>This parameter has been removed from the latest versions and replaced by the AccessTokens parameter.
237+
This parameter has been reintroduced in preview with version 4.7.1-preview. For more information about Application-based authentication and supported cmdlets, see [Application-based authentication in Teams PowerShell Module](/MicrosoftTeams/teams-powershell-application-authentication).
186238
187239
```yaml
188240
Type: String
@@ -195,10 +247,10 @@ Accept pipeline input: False
195247
Accept wildcard characters: False
196248
```
197249
198-
### -CertificateThumbprint (Removed from version 2.4.1-preview)
199-
Specifies the certificate thumbprint of a digital public key X.509 certificate of a user account that has permission to perform this action.
200-
> [!WARNING]
201-
>This parameter has been removed from version 2.4.1-preview.
250+
### -CertificateThumbprint
251+
Specifies the certificate thumbprint of a digital public key X.509 certificate of an application that has permission to perform this action.
252+
253+
This parameter has been reintroduced in preview with version 4.7.1-preview. For more information about Application-based authentication and supported cmdlets, see [Application-based authentication in Teams PowerShell Module](/MicrosoftTeams/teams-powershell-application-authentication).
202254
203255
```yaml
204256
Type: String

0 commit comments

Comments
 (0)