Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,18 +1,67 @@
### Example 1: {{ Add title here }}
### Example 1: Retrieves a list of all conditional access policies in Azure AD.
```powershell
PS C:\> {{ Add code here }}
PS C:\> Get-MgConditionalAccessPolicy

{{ Add output here }}
Id CreatedDateTime Description DisplayName ModifiedDateTime State
-- --------------- ----------- ----------- ---------------- -----
99dac946-5c4a-42de-ac16-76159af6a584 User Policy for Exchange 4/3/2020 7:22:14 PM enabled
ff402a0f-fa39-4d7e-bbe6-63b91c89f3d8 XYZ enabled
5f06ee26-a784-4ead-9327-ef617b2c50be 4/3/2020 7:58:10 PM Test Policy 1 4/3/2020 8:16:44 PM disabled
dd3d362a-5d8a-4f88-b335-a23bd88f8dac 4/7/2020 5:06:10 PM User Policy for Exchange enabled
486358c9-25bd-401a-a40a-607ce5cf18a2 4/7/2020 5:07:15 PM User Policy for Exchange enabled
a65f1a0c-3417-4cd2-b141-365223c38288 4/7/2020 5:08:42 PM User Policy for Exchange enabled
c7d7a349-60e1-4130-b9d2-044244a93177 4/10/2020 7:06:22 PM Device state policy 1 enabled
2d306301-1dfe-44a7-9e7a-84279a332de0 4/14/2020 5:25:45 AM MFA Test Policy 4/14/2020 5:27:25 AM enabled
27d299c0-b597-4fed-a471-2708c909683c 4/23/2020 5:00:44 PM ReportOnlyTest enabledForReportingButNotEnforced
f935790a-ed33-41be-b525-7f331f4d692a 4/23/2020 5:02:51 PM ReportOnlyTest enabledForReportingButNotEnforced
2029f5f8-87d1-48dc-b42e-7367bc0b40ce 4/24/2020 7:29:10 PM MFA policy disabled
e865f454-d27f-4f8d-8f78-edb9839689b1 5/7/2020 4:47:54 PM User Policy for Exchange enabled
b84c8b50-f5f5-46a7-b3a8-48326f16f1d7 5/7/2020 4:50:25 PM User Policy for Exchange enabled
98f92b11-70ed-4977-b22e-948ed0633073 5/7/2020 4:50:59 PM User Policy for Exchange enabled
```

{{ Add description here }}
This command retrieves a list of all conditional access policies in Azure AD.

### Example 2: {{ Add title here }}
### Example 2: Retrieves a conditional access policy in Azure AD with given Id.
```powershell
PS C:\> {{ Add code here }}
PS C:\> Get-MgConditionalAccessPolicy -ConditionalAccessPolicyId 99dac946-5c4a-42de-ac16-76159af6a584 | Format-List | More

{{ Add output here }}
ApplicationEnforcedRestrictionIsEnabled :
ApplicationExcludeApplications : {}
ApplicationIncludeApplications : {18899b4f-04e9-4da5-874a-bfc2f73e9dae, 00000002-0000-0ff1-ce00-000000000000}
ApplicationIncludeUserActions : {}
CloudAppSecurityCloudAppSecurityType :
CloudAppSecurityIsEnabled :
ConditionClientAppTypes : {}
ConditionSignInRiskLevels : {}
CreatedDateTime :
Description :
DeviceStateExcludeStates :
DeviceStateIncludeStates :
DisplayName : User Policy for Exchange
GrantControlBuiltInControls : {compliantDevice}
GrantControlCustomAuthenticationFactors : {}
GrantControlOperator : OR
GrantControlTermsOfUse : {}
Id : 99dac946-5c4a-42de-ac16-76159af6a584
LocationExcludeLocations :
LocationIncludeLocations :
ModifiedDateTime : 4/3/2020 7:22:14 PM
PersistentBrowserIsEnabled :
PersistentBrowserMode :
PlatformExcludePlatforms :
PlatformIncludePlatforms :
SignInFrequencyIsEnabled :
SignInFrequencyType :
SignInFrequencyValue :
State : enabled
UserExcludeGroups : {}
UserExcludeRoles : {}
UserExcludeUsers : {}
UserIncludeGroups : {}
UserIncludeRoles : {}
UserIncludeUsers : {853a6905-8948-4678-8056-bb12225d64f4}
```

{{ Add description here }}
This command retrieves a conditional access policy in Azure AD.

Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
### Example 1: {{ Add title here }}
### Example 1: Creates a new conditional access policy in Azure AD that require MFA to access Exchange Online.
```powershell
PS C:\> {{ Add code here }}
PS C:\> New-MgConditionalAccessPolicy -DisplayName "MFA Policy" -State "Enabled" -ApplicationIncludeApplications "00000002-0000-0ff1-ce00-000000000000" -UserIncludeUser "All" -GrantControlBuiltInControls "mfa" -GrantControlOperator "OR"

{{ Add output here }}
Id CreatedDateTime Description DisplayName ModifiedDateTime State
-- --------------- ----------- ----------- ---------------- -----
f550037b-d9ba-4b0f-890b-bb3c346fc11d 5/12/2020 6:05:11 PM MFA Policy enabled
```

{{ Add description here }}
This command creates a new conditional access policy in Azure AD that require MFA to access Exchange Online.

### Example 2: {{ Add title here }}
### Example 2: Creates a new conditional access policy in Azure AD that blocks access to Exchange Online from non-trusted regions.
```powershell
PS C:\> {{ Add code here }}
PS C:\> New-MgConditionalAccessPolicy -DisplayName "Block Policy" -State "Enabled" -ApplicationIncludeApplications "00000002-0000-0ff1-ce00-000000000000" -UserIncludeUser "All" -LocationIncludeLocations "198ad66e-87b3-4157-85a3-8a7b51794ee9" -GrantControlBuiltInControls "block" -GrantControlOperator "OR"

{{ Add output here }}
Id CreatedDateTime Description DisplayName ModifiedDateTime State
-- --------------- ----------- ----------- ---------------- -----
dbc86c64-3472-4744-8792-182041e4a339 5/12/2020 6:21:15 PM Block Policy enabled
```

{{ Add description here }}
This command creates a new conditional access policy in Azure AD that blocks access to Exchange Online from non-trusted regions.

Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
### Example 1: {{ Add title here }}
### Example 1: Updates a conditional access policy in Azure AD by PolicyId.
```powershell
PS C:\> {{ Add code here }}
PS C:\> Update-MgConditionalAccessPolicy -ConditionalAccessPolicyId 99dac946-5c4a-42de-ac16-76159af6a584 -State "disabled"

{{ Add output here }}
This command does not return a response
```

{{ Add description here }}

### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}

{{ Add output here }}
```

{{ Add description here }}
This command updates the state of a conditional access policy in Azure AD.