Power Apps 许可证的自动申领策略

作为管理员,您通常会手动向用户分配许可证。 Power Apps 许可证的自动申请使管理员可以在 Microsoft 365 管理中心内轻松制定策略,就像他们可以为其他 Microsoft 产品和服务制定策略一样。 配置策略后,在以下情况下,组织中需要个人 Power Apps 许可证的任何用户都会自动获得一个许可证:

  • 如果用户缺少独立 Power Apps 许可证,并启动需要高级许可证的应用程序,系统会自动为该用户分配 Power Apps 每用户许可证。
  • 如果没有独立Power Apps许可证的用户在托管环境中启动应用,则会自动向用户授予每个用户许可证Power Apps。

您可以在 Microsoft 365 管理中心中创建和管理这些自动声明策略。

备注

美国主权云(GCC、GCC-H、DOD)不支持自动声明策略。

为 Power Apps 许可证创建自动申请策略

使用以下信息为 Power Apps 创建自动声明策略。

有关在 Microsoft 365 管理中心管理自动申请策略的更多信息,请访问在 Microsoft 365 管理中心管理自动申请策略

谁可以创建和管理自动申请策略?

要创建和管理自动申请策略,您必须拥有全局管理员权限。 有关更多信息,请访问 Microsoft 365 管理中心中的管理员角色

打开自动申请策略功能

在创建自动申请策略之前,您必须首先在 Microsoft 365 管理中心启用该功能。

  1. 转到 Microsoft 365 管理中心
  2. 导航菜单中,选择计费>许可证
  3. 选择自动申请策略选项卡。
  4. 点击打开设置按钮。

打开该功能后,您可以创建一个自动申请策略。

为 Power Apps 创建自动申请策略

自动申请策略选项卡显示您创建的策略。 您可以查看策略的名称、关联的应用程序、分配的产品、可用的许可证以及策略的状态。

要创建新策略,请完成以下步骤。

  1. 在 Microsoft 365 管理中心,点击计费>许可证
  2. 点击自动申请策略选项卡。
  3. 点击添加策略
  4. 命名此自动申请策略页面上,输入策略的名称,然后点击下一步
  5. 设置自动申领的应用和产品页面上,在下拉列表中选择 Power Apps 每用户计划。 您可以按用户分配产品许可证,也可以选择将用户添加到安全组选项并选择相应的组。
  6. 选择应用程序页面上,选择或清除要包含在许可证中或从许可证中排除的应用程序的复选框。 单击下一步
  7. 查看并完成页面上,验证新策略信息,进行任何必要的更改,然后点击创建策略

默认情况下启用自动申请策略

为了简化管理员的许可证管理,在具有托管环境的租户中,自动声明策略不需要管理员手动激活。 自动认领策略会自动创建。 从 2023 年 12 月开始,系统会在具有托管环境的租户的 Microsoft 365 管理中心中生成一个适用于 Power Apps 每用户许可证的自动分配策略,其标题为 Auto-Created Policy for Power Apps。 根据此策略,如果某个没有 Power Apps 按用户许可证的用户在托管环境中启动某个应用,且你的租户中有可用的 Power Apps 按用户许可证,则系统会自动向该用户分配一个此类许可证。

默认情况下,当用户在托管环境中打开Power Apps时,将应用此策略。 管理员还可以通过 Power Platform 管理中心中的一项设置,选择将此策略扩展到在标准环境中打开的 Power Apps。

从 2024 年 2 月开始,拥有新 Power Apps premium 许可证的租户将自动在 Microsoft 365 管理中心为 Power Apps 设置自动创建的策略。 自动创建的策略可确保没有许可证并启动需要高级许可证的 Power Apps 的任何用户将自动从租户的可用许可证中获得 Power Apps premium 许可证。 这一过程使访问更加顺畅,并使许可证管理更加简单。 默认情况下,此策略适用于所有环境。

管理员可以更新策略吗?

是,管理员可以在 Microsoft 365 管理中心管理该策略,就像任何其他自动申请策略一样。 管理员可以禁用、删除该策略,并查看为哪些用户分配了许可证的报告。

在 Power Platform 管理中心,管理员可以决定策略是仅应用于托管环境还是所有环境。

  1. Power Platform 管理中心中,转到设置并点击自动申请策略选项。
  2. 自动申请策略窗格中,选择该策略是适用于所有环境还是仅适用于托管环境

支持基于组的许可证分配

管理员可以配置策略,将用户添加到预定义的组中进行许可证分配,而不是在用户启动 Power Apps 时直接为其分配许可证。

创建自动申请策略时,在为 Power Apps 创建自动申请策略过程中的设置自动申请应用和产品步骤中,管理员可以按用户分配产品许可证,或者选择将用户添加到安全组选项并选择相应的组。 该选项目前用于 Power Apps 和 Power Automate。

备注

按安全组分配许可证最多可能需要 24 小时才能分配许可证。

如果您的组织已经有许可证分配的现有流程,管理员仍然可以在维护其当前工作流程的同时利用自动申请策略。

管理员可以查看通过 Microsoft 365 管理中心中的自动申请策略分配了许可证的用户列表。 然后,他们可以根据需要进行更改,例如取消分配通过自动声明分配的许可证,并将用户移至指定组,以使用 Microsoft Entra 基于组的许可证分配。 有关基于组的许可的更多信息,请访问基于组的许可附加方案

这里有一些命令可以帮助取消分配许可证和将用户添加到所需的 Microsoft Entra 组。

##
#Install and import AzureAD PowerShell module prior to running these commands
##
##You may be able to get a list of users, that have been auto-assigned a 
##license directly, via Microsoft Admin Center. Follow instructions at 
##https://learn.microsoft.com/en-us/microsoft-365/commerce/licenses/manage-auto-claim-policies?view=o365-worldwide#view-an-auto-claim-policy-report
##
##Once you have a list of users, you can use the following commands to remove 
##the direct license assignment and add the user to a licensed group, or 
##you may tweak the script to iterate through a list of users and 
##perform this in bulk
##
##Please note that adding a user to a licensed group may not result in an 
##immediate license assignment. Refer to https://learn.microsoft.com/en-us/entra/identity/users/licensing-group-advanced for more information
#############################################>

$Credential = Get-Credential

# Connect to Azure AD
Connect-AzureAD -Credential $Credential

#The user that will get a group based license
$LicensedUser = Get-AzureADUser -SearchString "<UPN, display name or object ID of the user for which you want to assign a license>"

#The group that has the license assigned
$LicensedGroup = Get-AzureADGroup -SearchString "<Object ID or name of the group that has a relevant license assigned>"

#SKU part number of the sku that needs to be unassigned (Power Apps Premium)
$SkuPartName = "POWERAPPS_PER_USER"

#Get the SkuID of the license that needs to be unassigned from the user
$LicenseSku = Get-AzureADSubscribedSku | Where-Object {$_.SkuPartNumber -eq $SkuPartName}

#Create the AssignedLicenses Object, used for removing direct license assignment from the user
$LicensesToRemove = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicenses
$LicensesToRemove.RemoveLicenses = $LicenseSku.SkuId

#Remove directly assigned license from the user
#Note that this command will result in an error if the user does not have the relevant license assigned directly
Set-AzureADUserLicense -ObjectId $LicensedUser.ObjectId -AssignedLicenses $LicensesToRemove

#Add user to a licensed group
Add-AzureADGroupMember -ObjectId $LicensedGroup.ObjectId -RefObjectId $LicensedUser.ObjectId