【问题标题】:Connect with teams from an Azure Automation with "run as" account使用“运行方式”帐户与来自 Azure 自动化的团队联系
【发布时间】:2023-03-11 14:22:01
【问题描述】:

我想从 Azure 自动化分配 Teams 策略。为此,我在当前版本中使用了 PowerShell 模块“MicrosoftTeams”。

当我使用用户凭据登录 Teams 时,如下所示,分配工作。

$Cred = Get-AutomationPSCredential -Name 'Teams-Admin'
Connect-MicrosoftTeams -TenantId $tenantId -Credential $Cred

# Grant policys
Grant-CsUserPolicyPackage -Identity $mailAddress -PackageName Test

但是,我想使用 Run-As 帐户登录,如下图所示。当我这样做时,我得到一个错误。

$connection = Get-AutomationConnection –Name AzureRunAsConnection
Connect-MicrosoftTeams -TenantId $connection.TenantID `
    -ApplicationId $connection.ApplicationID `
    -CertificateThumbprint $connection.CertificateThumbprint

# Grant policys
Grant-CsUserPolicyPackage -Identity $mailAddress -PackageName Test

错误如下:

Grant-CsUserPolicyPackage : Powershell 管理域意外地为空/空

“运行方式”帐户的应用注册表具有团队管理员和 Skype for Business 管理员角色。此外,我已将 API 权限中的“AppCatalog.ReadWrite.All”、“Group.ReadWrite.All”、“User.Read.All”权限委派给 Microsoft Graph,并将“user_impersonation”权限委派给 Skype 和 Teams 租户管理 API。

【问题讨论】:

  • 您能分享一下您的团队模块版本吗?
  • @HunaidHanfee-MSFT 我使用 MicrosoftTeams 模块 2.3.1 版

标签: powershell microsoft-teams azure-automation azure-authentication


【解决方案1】:

目前不支持服务主体名称。我们有这方面的待办事项,但没有 ETA 可分享。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-10-29
    • 2020-09-13
    • 2017-07-23
    • 2021-09-06
    • 1970-01-01
    • 2023-02-16
    • 2022-12-02
    相关资源
    最近更新 更多