Get-EntraConditionalAccessPolicy
Gets a Microsoft Entra ID conditional access policy.
Syntax
Get-EntraConditionalAccessPolicy
[-Property <String[]>]
[<CommonParameters>]
Get-EntraConditionalAccessPolicy
-PolicyId <String>
[-Property <String[]>]
[<CommonParameters>]
Description
This cmdlet allows an admin to get the Microsoft Entra ID conditional access policy. Conditional access policies are custom rules that define an access scenario.
Examples
Example 1: Retrieves a list of all conditional access policies in Microsoft Entra ID
Connect-Entra -Scopes 'Policy.Read.All'
Get-EntraConditionalAccessPolicy
Id CreatedDateTime Description DisplayName ModifiedDateTime State TemplateId
-- --------------- ----------- ----------- ---------------- ----- ----------
eeeeeeee-4444-5555-6666-ffffffffffff 2/27/2024 6:23:21 AM ConditionalAccessPolicy 2/29/2024 2:41:17 PM disabled
ffffffff-5555-6666-7777-aaaaaaaaaaaa 2/27/2024 6:26:00 AM ConditionalAccessPolicy 2/29/2024 2:41:34 PM disabled
aaaaaaaa-6666-7777-8888-bbbbbbbbbbbb 2/27/2024 6:30:48 AM ConditionalAccessPolicy 2/29/2024 2:43:53 PM disabled
This example retrieves a list of all conditional access policies in Microsoft Entra ID.
Example 2: Retrieves a conditional access policy in Microsoft Entra ID with given ID
Connect-Entra -Scopes 'Policy.Read.All'
Get-EntraConditionalAccessPolicy -PolicyId 'eeeeeeee-4444-5555-6666-ffffffffffff'
Id CreatedDateTime Description DisplayName ModifiedDateTime State TemplateId
-- --------------- ----------- ----------- ---------------- ----- ----------
eeeeeeee-4444-5555-6666-ffffffffffff 2/27/2024 6:23:21 AM ConditionalAccessPolicy 2/29/2024 2:41:17 PM disabled
This example retrieves a specified conditional access policy in Microsoft Entra ID.
-PolicyId
parameter specifies the Id of a conditional access policy.
Parameters
-PolicyId
Specifies the ID of a conditional access policy in Microsoft Entra ID.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Property
Specifies properties to be returned.
Type: | System.String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |