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. 選取應用程式頁面上,選取或清除應用程式的核取方塊,以包括或排除授權。 按一下 Next
  7. 檢閱並完成頁面上,確認新的原則資訊、進行任何必要的變更,然後按一下建立原則

預設會啟用自動宣告原則

為簡化管理員的授權管理流程,在受控環境的租用戶中,自動宣告原則不需要管理員手動啟動。 自動宣告原則會自動建立。 從 2023 年 12 月開始,將在 Microsoft 365 系統管理中心為具有受控環境的租用戶產生名為 Power Apps 自動建立原則的 Power Apps 依使用者授權的授權自動宣告原則。 根據此原則,如果沒有 Power Apps 依使用者授權的使用者在受控環境中啟動應用程式,則該使用者將自動收到 Power Apps 依使用者授權 (如果您的租用戶中有可用授權)。

預設情況下,當使用者在託管環境中開啟 Power Apps 時,會套用此原則;但是,管理員可以選擇擴充此原則到以涵蓋在標準環境中開啟的 Power Apps,也可以透過 Power Platform 管理中心中的設定進行設定。

從 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