Power Apps 许可证的自动声明政策

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

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

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

为 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 自动创建策略的 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. 自动申请策略窗格中,选择该策略是适用于所有环境还是仅适用于托管环境

支持基于组的许可证分配

自动申请策略支持个人许可证分配,这意味着许可证被分配给个人用户。 如果您的组织已经有许可证分配的现有流程,管理员仍然可以在维护其当前工作流程的同时利用自动申请策略。

管理员可以查看通过 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://video2.skills-academy.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://video2.skills-academy.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