全て
| カテゴリ未分類
| 通常
| 数学
| 投資
| 副業
| 転職・就職
| ブログ
| 株Stock
| VBA
| SharePoint
| REST API
| RenderListDataAsStream
| PowerAutomateDesktop
| Graph API
| PowerApps
| PowerAutomate
| PowerFx
| OfficeScriptオフィススクリプト
| PowerAutomate日時Excel日時相互関係
| PowerShell
| Dataverse
| UiPath
| OneDrive
| LINQ
| VB.NET
| C#.NET
| WPFC#.NET
| Git
カテゴリ:Graph API
# Microsoft Graph SDK のインストール Install-Module -Name Microsoft.Graph.Teams # アプリケーションの認証情報 $clientId = "YOUR_CLIENT_ID" $clientSecret = "YOUR_CLIENT_SECRET" $tenantId = "YOUR_TENANT_ID" # アクセストークンの取得 $accessToken = Get-MgAccessToken -ClientId $clientId -ClientSecret $clientSecret -TenantId $tenantId if (-not [string]::IsNullOrEmpty($accessToken)) { Write-Host "Access Token: $accessToken" # チームの ID $teamId = "YOUR_TEAM_ID" # 新しいチャネルの作成 $channelName = "New Channel" $channelDescription = "This is a new channel created using Teams Graph API" $channelBody = @{ DisplayName = $channelName Description = $channelDescription MembershipType = "standard" # "standard" または "private" を選択 } | ConvertTo-Json $createChannelUrl = "https://graph.microsoft.com/v1.0/teams/$teamId/channels" $createChannelResponse = Invoke-RestMethod -Uri $createChannelUrl -Method Post -Headers @{ Authorization = "Bearer $accessToken" 'Content-Type' = 'application/json' } -Body $channelBody if ($createChannelResponse) { Write-Host "New channel created successfully. Channel ID: $($createChannelResponse.id)" } else { Write-Host "Failed to create new channel." } } else { Write-Host "Failed to retrieve access token." } お気に入りの記事を「いいね!」で応援しよう
Last updated
2024.02.26 03:22:47
[Graph API] カテゴリの最新記事
|