Find-EntraPermission

協助使用者判斷資源所需的權限,並辨識各種指令所需的適當權限。

語法

Find-EntraPermission

    [-SearchString] <String>
    [-ExactMatch]
    [-PermissionType <String>]
    [-Online]
    [<CommonParameters>]

All

Find-EntraPermission

    [-PermissionType <String>]
    [-Online]
    [-All]
    [<CommonParameters>]

Description

指令 Find-EntraPermission 長程式協助使用者判斷資源所需的權限,並識別各種指令所需的適當權限。

範例

範例 1:取得所有應用程式權限清單

Find-EntraPermission application
PermissionType: Delegated

Id                                   Consent Name                                      Description
--                                   ------- ----                                      -----------
c79f8feb-a9db-4090-85f9-90d820caa0eb Admin   Application.Read.All                      Allows the app to read applications and service principals on behalf of the signed-in user.
bdfbf15f-ee85-4955-8675-146e8e5296b5 Admin   Application.ReadWrite.All                 Allows the app to create, read, update and delete applications and service principals on behalf of the signed-in user. Does not allow management of consent grants.

PermissionType: Application

Id                                   Consent Name                                      Description
--                                   ------- ----                                      -----------
9a5d68dd-52b0-4cc2-bd40-abcf44ac3a30 Admin   Application.Read.All                      Allows the app to read all applications and service principals without a signed-in user.
1bfefb4e-e0b5-418b-a88f-73c46d2cc8e9 Admin   Application.ReadWrite.All                 Allows the app to create, read, update and delete applications and service principals without a signed-in user.  Does not allow management of consent grants.
18a4783c-866b-4cc7-a460-3d5e5662c884 Admin   Application.ReadWrite.OwnedBy             Allows the app to create other applications, and fully manage those applications (read, update, update application secrets and delete), without a signed-in user...

範例 2. 取得讀取權限的權限清單

Find-EntraPermission application.Read | Format-List
Id             : c79f8feb-a9db-4090-85f9-90d820caa0eb
PermissionType : Delegated
Consent        : Admin
Name           : Application.Read.All
Description    : Allows the app to read applications and service principals on behalf of the signed-in user.

Id             : bdfbf15f-ee85-4955-8675-146e8e5296b5
PermissionType : Delegated
Consent        : Admin
Name           : Application.ReadWrite.All
Description    : Allows the app to create, read, update and delete applications and service principals on behalf of the signed-in user. Does not allow management of consent grants.

Id             : 9a5d68dd-52b0-4cc2-bd40-abcf44ac3a30
PermissionType : Application
Consent        : Admin
Name           : Application.Read.All
Description    : Allows the app to read all applications and service principals without a signed-in user.

範例 3. 搜尋完全匹配的權限

Find-EntraPermission -SearchString 'User.Read.All' -ExactMatch
   PermissionType: Delegated

Id                                   Consent Name          Description
--                                   ------- ----          -----------
a154be20-db9c-4678-8ab7-66f6cc099a59 Admin   User.Read.All Allows the app to read the full set of profile properties, reports, and ma…

   PermissionType: Application

Id                                   Consent Name          Description
--                                   ------- ----          -----------
df021288-bdef-4463-88db-98f22de89214 Admin   User.Read.All Allows the app to read user profiles without a signed in user.

此範例示範如何搜尋與指定權限名稱完全匹配的權限。

範例四。 取得所有指定類型的權限

Find-EntraPermission -PermissionType 'Delegated'
Id                                   Consent Name                                                    Description
--                                   ------- ----                                                    -----------
ebfcd32b-babb-40f4-a14b-42706e83bd28 Admin   AccessReview.Read.All                                   Allows the app to read access re…
e4aa47b9-9a69-4109-82ed-36ec70d85ff1 Admin   AccessReview.ReadWrite.All                              Allows the app to read, update, …
5af8c3f5-baca-439a-97b0-ea58a435e269 Admin   AccessReview.ReadWrite.Membership                       Allows the app to read,

此範例展示了如何取得指定類型 Delegated 的所有權限,例如 Application 權限。

參數

-All

如果指令檔返回所有參數,則設定。

參數屬性

類型:System.Management.Automation.SwitchParameter
預設值:False
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-ExactMatch

如果搜尋字串應該完全匹配。

參數屬性

類型:System.Management.Automation.SwitchParameter
預設值:False
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Online

在 Find-MgGraphPermission 搜尋前,請使用 -Online 參數與 -SearchString 在搜尋前取得Microsoft Graph的最新權限。 這確保 Find-MgGraphPermission 透過包含任何新增的 API 權限,回傳準確的結果。 此指令使用由 Connect-MgGraph 建立的現有 Microsoft Graph 連線。 如果你的連線沒有權限存取這些資料,或沒有網路連線,指令就會失敗。 更新後,Find-MgGraphPermission 未來搜尋仍會使用更新後的權限清單,即使不使用 -Online 參數。

參數屬性

類型:System.Management.Automation.SwitchParameter
預設值:False
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-PermissionType

指定權限類型,例如委派權限或應用程式。

參數屬性

類型:System.String
預設值:Any
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-SearchString

指定權限的過濾器,例如域與範圍。

參數屬性

類型:System.String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:True
來自管線的值:True
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

CommonParameters

此 Cmdlet 支援一般參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters。