Menu
Modern Workplace Blog
  • Home
  • About: Kenneth van Surksum
  • Cookie Policy
Modern Workplace Blog
June 26, 2020March 24, 2021

Limit Access to Outlook Web Access, SharePoint Online and OneDrive using Conditional Access App Enforced Restrictions

One of the scenario’s we can build with Conditional Access, is the scenario where we restrict access inside the web application itself. By doing so, you could for example limit the functionality of the web applications on non-managed devices, or when accessing the web application from a country where your company normally doesn’t operate. The web applications can be configured to behave differently if the user is applicable for a Conditional Access policy where App Enforced restrictions are configured.

Within the Office 365 suite of applications, the following web applications are supported for App Enforced Restrictions:

  • Outlook Web Access
  • SharePoint and OneDrive

In this post I will go into detail on how to setup these app enforced restriction and what the expected behavior will be from an end-user perspective.

Update December 2020: I’ve written another article on this subject which might be interesting as well: Defining more granularity for your Conditional Access App Enforced Restrictions using Sensitivity Labels

Configure Outlook Web Access for limited access via App Enforced Restrictions

Before you can enable Conditional Access App Enforced Restrictions you first need to enable the feature in the default OWA mailbox policy, since by default this functionality is turned off, this can be done using the Set-OwaMailBoxPolicy cmdlet as part of the Exchange Online PowerShell module.

First request the current status of the OWA mailbox policy by executing the following command: Get-OwaMailBoxPolicy |select-object ConditionalAccess*. This command will return the current status of the ConditionalAccessPolicy (On or Off) and the ConditionalAccessFeatures.

If the ConditionalAccessPolicy is set to Off, you can enable the functionality which allows for restrictions when used in combination with a Conditional Access App Enforced Restriction policy. You have either the option to configure the policy in two modes:

  • ReadOnly, where users can’t download attachments to their local computer, and can’t enable Offline Mode on non-compliant computers
  • ReadOnlyPlusAttachmentsBlocked, in the ReadOnly setting viewing attachments in the browser is possible, when using this setting viewing attachments in the browser is blocked.

In this example we are going to enable the ConditionalAccessPolicy in the OWA Mailbox Policy and use the ReadOnly mode, this can be accomplished by executing the following command: Set-OwaMailBoxPolicy -Identity OwaMailboxPolicy-Default -ConditionalAccessPolicy ReadOnly

After executing the command make sure that you check whether the setting was succesfull by executing the Get-OwaMailBoxPolicy |select-object ConditionalAccess* command again and check whether the ConditionalAccessPolicy is set to ReadOnly

Machine generated alternative text:
Windows PowerSheII 
PS C: Get-Owamai180xPoIicy 
onditionaIAccessPoIicy ConditionalAccessFeatures 
PS C: Set-Owamai180xPoIicy 
PS C: Get-Owamai180xPoIicy 
onditionaIAccessPoIicy ConditionalAccessFeatures 
select- object ConditionalAccess* 
-Identity OwamaiIboxPoIicy-DefauIt 
I select-object ConditionalAccess* 
-ConditionalAccessPoIicy 
ReadOnIy 
AttachmentDirectFiIeAccessOnP... 
ReadOnIy 
PS C: 
{Offline, AttachmentDirectFiIeAccessOnPrivateComputersEnabIed,
Set Conditional Access options in OWA Mailbox Policy using PowerShell

Configure SharePoint Online and OneDrive for limited access via App Enforced Restrictions

SharePoint Online and OneDrive can be configured in several ways. The first option is to set a Global setting which becomes effective for all SharePoint Online and OneDrive sites in your environment, and the Per site option allows you to specify options per site.

Global settings

The Global or organizational-wide settings can be configured from the SharePoint admin center (https://<tenantname>-admin.sharepoint.com). In the SharePoint Admin center select Policies | Access Control and select Unmanaged devices.

By default, for unmanaged devices the option “Allow full access from desktop apps, mobile apps, and the web” is selected, and by modifying the option to either “Allow limited, web-only access” or “Block access” you configure limited access for your whole environment.

Machine generated alternative text:
Unmanaged devices 
(D We will automatically change the "Apps that don't use modern authentication" setting to block 
access (because these apps can't enforce this device-based restriction). 
The setting you select here will apply to all users in your organization. Learn more. To 
customize conditional access policies, save your selection and go to the Azure AD admin 
center. 
O Allow full access from desktop apps, mobile apps, and the web 
O Allow limited, web-only access 
O 
Block access 
If you don't want to limit or block access organization-wide, you can do so for specific 
sites. Learn how 
Cancel 
x
Unmanaged devices behavior settings from SharePoint Admin Center

If you configure the unmanaged devices settings, 2 new Conditional Access policies will be created. While I’m not a big fan of letting a setting like create the Conditional Access policies for you, they do provide some valuable information. I would therefore suggest to let the wizard create them, and that you turn them off immediately after creation. Keep in mind that if you are playing with these, it might be that several Conditional Access policies are created (one per day, since the day when created in defined in the name).

Also note that if you use the PowerShell way to create the setting in the SPOtenant, the policies will also be created and are active for all your users. (which can have impact if you want to test first).

Machine generated alternative text:
[Share?oint admin centerlBlock access from apps on unmanaged devices - 2020-06-25 
[SharePoint admin centerlUse app-enforced Restrictions for browser access - 2020-06-25
Automatically created Conditional Access Policies

The first one “[SharePoint admin center]Block access from apps on unmanaged devices – 2020-06-25” has the following properties

Name[SharePoint admin center]Block access from apps on unmanaged devices – 2020-06-25
Assignments
Users and GroupsAll Users
Cloud apps or actionsOffice 365 SharePoint Online
Conditions
Client AppsModern Authentication Clients
Access controls
GrantRequire device to be marked as compliant OR Require Hybrid Azure AD joined device

So, to summarize this policy grants access to either Compliant Azure AD joined devices or Hybrid joined (AD joined, Azure AD registered) devices when the client supports Modern Authentication while accessing SharePoint Online.

So having clients which support Modern Authentication is crucial for this, I’ve already written a lot more on this topic for which you can find the latest information here: “May 2020 update of the Conditional Access Demystified Whitepaper, Workflow cheat sheet, Implementation workflow and Documentation spreadsheet”

The second one “[SharePoint admin center]Use app-enforced Restrictions for browser access – 2020-06-25” has the following properties

NameUse app-enforced Restrictions for browser access – 2020-06-25
Assignments
Users and GroupsAll Users
Cloud apps or actionsOffice 365 SharePoint Online
Conditions
Client AppsBrowser
Access controls
SessionUse app enforced restrictions

This conditional access policy when applicable gives SharePoint online, the signal that the limited access is applicable.

Per site settings

For a basic environment, having these global settings might be enough, but perhaps you want to more granularly control whether you want the limited access applied to a SharePoint or OneDrive site. This can be accomplished by using PowerShell (for now, more on that later) and described in the following section “Block or limit access to a specific SharePoint site or OneDrive” of the article: “Control access from unmanaged devices” in the SharePoint online documentation.

In order to use PowerShell you must have the SharePoint Online Management Shell installed, once installed, you can connect using

Connect-SPOService -Url https://<tenantname>-admin.sharepoint.com which will log you in, into the Management Shell

From there you can determine the current status of a particular SharePoint site using the following command.

Get-SPOSite -Identity https://<SharePoint online URL>/sites/<name of site or OneDrive account> -Detailed | fl Conditional*

Machine generated alternative text:
Administrator: Windows PowerSheII 
PS C: Get-SPOSite 
-1 aentltv 
https // insight24. sharepaint . corn,' sites/ demo- klantl 
-L'etalleä 
I fl Conditio 
nditionaIAccessPoIicy : 
AllowFuIIAccess
Get current setting on SharePoint site

As you can see, this command has a strange outcome, since on a Global level we just defined Read Only Access. Turns out that if you specify the setting on site level, this will override the global policy.  So for example, you could set the option “Allow limited, web-only access” as described above in the Global policy, but define a setting to Block Access on the Site level.

You can set the policy on a site level by executing the following command: Set-SPOSite -Identity https://<SharePoint online URL>/sites/<name of site or OneDrive account> -ConditionalAccessPolicy <value>

Machine generated alternative text:
Administrator: Windows PowerSheII 
PS C: Set-SPOSite 
BlockAccess 
PS C: Get-SPOSite 
-1 aencltb' 
-identity 
https // insight24 . sharepaint . corn/ sites/ demo- klantl 
https : // i nsight24. sharepoint . com/sites/demo- kl antl 
-L cnalclcnaleccessycl-_ 
-Detailed I fl Conditio 
ConditionalAccessPoIicy : 
310ckAccess
Set Conditional Access setting on site level

For the ConditionalAccessPolicy parameter the following values are available:

  • AllowFullAccess: The default setting
  • AllowLimitedAccess: The setting allowing limited access
  • BlockAccess: Blocks access

When using the AllowLimitedAccess option, you can supply additional parameters to further define the behavior, as detailed in “Advanced Configurations“, for example you can provide the option -LimitedAccessFileType OtherFiles after the -ConditionalAccess AllowLimitedAccess parameter to allow users to download files that can’t be previewed, such as .ZIP files.

If you have to specify this for a lot of SharePoint sites, you can of course automate these settings, but wouldn’t it be nice if we could enable this from the GUI while creating the SharePoint site, or while the SharePoint site is created as part of a Teams environment .

Sensitivity labels for Containers

Microsoft is currently rolling out new functionality which allows you to specify the behavior described above by making use of Sensitivity Labels and apply them to so called “containers” (announcement here: General Availability: Microsoft Information Protection sensitivity labels in Teams/SharePoint sites). These containers are either Microsoft Teams, Microsoft 365 Groups and SharePoint sites. Once enabled, the Sensitivity label will receive the “Site and group setting” options as detailed in the picture below.

The idea is that when creating one of the containers, you must specify the Sensitivity as well. In the Sensitivity label you can define which setting related to the ConditionalAccessPolicy parameter on the container you want to assign. You also have the possibility to assign a sensitivity label to already existing Team or SharePoint sites.

Once this functionality is available in your tenant, you can use the sensitivity label to specify the access to the environment when App Enforced Restrictions are in use.

Machine generated alternative text:
Edit sensitivity label 
e Name & description 
e Encryption 
e Content marking 
Site and group settings 
O 
Auto-labeling for Office apps 
O 
Review your settings 
Site and group settings 
Select the settings you want to take effect when this label is applied to an Office 365 group or SharePoint site. Note that the settings aren't applied to 
files, so they don't impact downloaded copies of files. Learn more about site and group protection 
Site and group settings 
Privacy of Office 365 group-connected team sites 
Private - only members can access the site 
External users access 
Let Office 365 group owners add people outside the organization to the group 
Unmanaged devices 
O Allow full access from desktop apps, mobile apps, and the web 
@ Allow limited, web only access 
O Block 
access 
Back 
Next 
Cancel 
O Need help?
Controlling access via Sensitivity labels

See: Use sensitivity labels to protect content in Microsoft Teams, Microsoft 365 groups, and SharePoint sites (public preview) and also read this very insightful article by Joanne C Klein titled: “Site Sensitivity and the documents within“

Create the Conditional Access Policy

Now that we created the necessary settings in both the OWA mailbox policy and SharePoint, we can define a Conditional Access policy or modify the automatically created Conditional Access policies for our scenario.

NameI24 – Block access from apps on unmanaged devices to EXO and SPO
Assignments
Users and GroupsAll Users, except Break Glass accounts
Cloud apps or actionsOffice 365 SharePoint Online, Office 365 Exchange Online
ConditionsClient AppsModern Authentication Clients
Access controls
GrantRequire device to be marked as compliant OR Require Hybrid Azure AD joined device
Policy 1: Only allow access from Azure AD joined compliant or Hybrid devices which use Modern Authentication
NameI24 – Block access from apps on unmanaged devices to EXO and SPO
Assignments
Users and GroupsAll Users, except Break Glass accounts
Cloud apps or actionsOffice 365 SharePoint Online, Office 365 Exchange Online
Conditions
Client AppsBrowser
Access controls
SessionUse App Enforced Restrictions
Policy 2: Use app enforced restrictions when accessing OWA and SPO via the web.

Policy behavior within Outlook Web Access

When the Conditional Access policy is applicable, the user accessing Outlook Web Access experiences the following behavior.

  • The user can access OWA just as normal, but with some restrictions
  • The restriction doesn’t allow for downloading or printing of attachments
  • Viewing of attachments in possible though
  • Even editing the attachment in the browser is possible

Policy behavior within SharePoint Online and OneDrive

When the Conditional Access policy is applicable, the user accessing SharePoint or OneDrive experiences the following behavior.

  • Within OneDrive, downloading, printing or syncing is prohibited
  • Within SharePoint, downloading, printing or syncing is prohibited

Conclusion

Conditional Access App Enforced Restrictions is another piece of the puzzle, allowing you to restrict access to your company data. The options described in this article provide a scenario which should be part of a much broader set of Conditional Access policies which you want to implement in order to protect your company data.

Having some more options to granularly define what can and cannot be done would be helpful, for example blocking the ability to upload files in the policies as well.

In the meantime Microsoft is adding more and more functionality to the sensitivity label functionality, and for which we can use some of that functionality in our Conditional Access scenario’s.

I hope this article provides you with a good idea of what’s possible with Conditional Access App Enforced Restrictions, and the contents of this article will be included in a next version of the Conditional Access Whitepaper. See: “May 2020 update of the Conditional Access Demystified Whitepaper, Workflow cheat sheet, Implementation workflow and Documentation spreadsheet” for the latest available version.

Tweet
Follow me
Tweet #WPNinjasNL

Continue Reading

← Azure AD Identity Protection deep dive
Conditional Access public preview functionality reviewed (22H2) – Part 2: Conditional Access filters for Apps and Workload Identities →

18 thoughts on “Limit Access to Outlook Web Access, SharePoint Online and OneDrive using Conditional Access App Enforced Restrictions”

  1. Pingback: How to prevent your users from downloading and installing Office via the Office portals | Modern Workplace Blog
  2. Pingback: Food for thought - Bring Your Own Disaster. - JanBakker.tech
  3. Pingback: Understanding and governing reauthentication settings in Azure Active Directory | Modern Workplace Blog
  4. Pingback: Defining more granularity for your Conditional Access App Enforced Restrictions using Sensitivity Labels | Modern Workplace Blog
  5. Pingback: Conditional Access demystified: My recommended default set of policies | Modern Workplace Blog
  6. Pingback: Defining more granularity for your Conditional Access App Enforced Restrictions using Sensitivity Labels - Tech Daily Chronicle
  7. Pingback: Food for thought – Bring Your Own Disaster. - Tech Daily Chronicle
  8. Ilias says:
    January 13, 2021 at 4:11 pm

    Hi great article 1st of all. But in your last comment about the conditional access rule creation you have not included the Session Use app enforced restrictions component. Is this a typo or ?

    Reply
    1. Kenneth says:
      January 13, 2021 at 4:21 pm

      Hi Ilias,

      Thank you for visiting my blog. You were right, it was definitely a typo. It should be a session control using App Enforced Restrictions. Thank you for bringing this to my attention, modified it right away.

      Regards,

      Kenneth

      Reply
  9. Pingback: Browser restrictions and configuration when using Conditional Access on your modern workplace | Modern Workplace Blog
  10. Tjal says:
    February 1, 2021 at 12:06 pm

    Hi Kenneth,

    Just wondering if the Block access from apps on unmanaged devices to EXO and SPO should block opening sharepoint/onedrive files from Office Apps. Because i still can open files on sharepoint on an unmanaged windows or mac device, seems strange.

    Also the OWA doesn’t seem to block the download option. Policy’s are exactly the same as described above and it’s a test environment so no other CA policies are applied for now.

    Reply
    1. Kenneth says:
      February 4, 2021 at 7:40 pm

      Hi Tjal,

      I’m pretty sure that you missed a step in the configuration. Did you also modify the settings necessary on the SharePoint side? Please also check in your Azure AD Sign-in logging whether the policy is applied to the login of your account.

      Thanks for visiting my blog,

      Regards,

      Kenneth

      Reply
  11. Pingback: Modern Workplace Management key takeaways from the Microsoft Ignite March 2021 announcements | Modern Workplace Blog
  12. Pingback: Modern Workplace Management key takeaways from the Microsoft Ignite March 2021 announcements - Tech Daily Chronicle
  13. Pingback: A first look at Azure AD Conditional Access authentication context | Modern Workplace Blog
  14. Jag says:
    August 25, 2021 at 8:38 am

    Hi Kenneth,

    Fantastic article and it helped me to resolve my issue.

    I have one question, i want to allow user to download the attachment using WEB who is on complaint and Azure AD joined device but dont want to allow him to download from non compliant or Azure AD join device.

    do you think it is possible?

    Regards
    Jag

    Reply
  15. Pingback: Https adding office 365 owa login from specific country Portal Guide Instructions Help - centtip.com
  16. Pingback: Blocking M365 Data exfiltration: Conditional Access – Sparrowtech

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Founding member of:

Recent Posts

  • MAM vs. MDM: Choosing the Right Mobile Management Approach
  • Comparing Web Filtering and Security: Microsoft Entra Internet Access (Global Secure Access) vs. Microsoft Defender for Endpoint (MDE)
  • Navigating New Authentication Methods: SMS for Password Reset, Not for MFA
  • From SPF to DANE: Securing Microsoft 365 Email Communications
  • Protecting your Break Glass accounts in Entra now that MFA gets enforced on more and more Admin portals

Books

System Center 2012 Service Manager Unleashed
Amazon
System Center 2012 R2 Configuration Manager Unleashed: Supplement to System Center 2012 Configuration Manager
Amazon
System Center Configuration Manager Current Branch Unleashed
Amazon
Mastering Windows 7 Deployment
Amazon
System Center 2012 Configuration Manager (SCCM) Unleashed
Amazon

Archives

  • February 2025
  • January 2025
  • September 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • September 2023
  • August 2023
  • February 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • May 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • August 2019
  • July 2019
  • November 2016
  • November 2015
  • June 2015
  • May 2015
  • November 2014
  • July 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • November 2013
  • August 2013
  • April 2013
  • March 2013
  • January 2013
  • December 2012
  • November 2012
  • August 2012
  • July 2012
  • June 2012

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Categories

  • ABM (4)
  • Advanced Threat Protection (4)
  • Announcement (44)
  • Azure (3)
  • AzureAD (73)
  • Certification (2)
  • Cloud App Security (5)
  • Conditional Access (58)
  • Configuration Manager (24)
  • Entra (2)
  • Entra Id (8)
  • Events (14)
  • Exchange Online (9)
  • Identity Protection (5)
  • Intune (27)
  • Licensing (2)
  • Microsoft Defender (1)
  • Microsoft Defender for Endpoint (1)
  • Microsoft Endpoint Manager (35)
  • Mobile Application Management (4)
  • Modern Workplace (74)
  • Office 365 (10)
  • Overview (11)
  • Power Platform (1)
  • PowerShell (2)
  • Presentations (9)
  • Privileged Identity Management (5)
  • Role Based Access Control (2)
  • Security (63)
  • Service Manager (4)
  • Speaking (30)
  • Troubleshooting (4)
  • Uncategorized (11)
  • Windows 10 (15)
  • Windows 11 (5)
  • Windows Update for Business (4)
  • WMUG.nl (16)
  • WPNinjasNL (32)

Tags

#ABM #AzureAD #community #conditionalaccess #ConfigMgr #IAM #Intune #m365 #MEM #MEMCM #microsoft365 #modernworkplace #office365 #security #webinar #wmug_nl ATP authentication strength AzureAD Branding Community Conditional Access ConfigMgr ConfigMgr 2012 Email EXO Identity Intune Licensing M365 MCAS MFA Modern Workplace Office 365 OSD PIM Policy Sets Presentation RBAC roles Security System Center Task Sequence troubleshooting webinar

Recent Comments

  • brc on Protecting your Break Glass accounts in Entra now that MFA gets enforced on more and more Admin portals
  • [m365weekly] #186 – M365 Weekly Newsletter on MAM vs. MDM: Choosing the Right Mobile Management Approach
  • Dean Gross on Comparing Web Filtering and Security: Microsoft Entra Internet Access (Global Secure Access) vs. Microsoft Defender for Endpoint (MDE)
  • nikhil tech on Protecting your Break Glass accounts in Entra now that MFA gets enforced on more and more Admin portals
  • Kenneth on Comparing Web Filtering and Security: Microsoft Entra Internet Access (Global Secure Access) vs. Microsoft Defender for Endpoint (MDE)

This information is provided “AS IS” with no warranties, confers no rights and is not supported by the author.

Copyright © 2021 by Kenneth van Surksum. All rights reserved. No part of the information on this web site may be reproduced or posted in any form or by any means without the prior written permission of the publisher.

Shorthand: Don’t pass off my work as yours, it’s not nice.

©2025 Modern Workplace Blog | Powered by WordPress and Superb Themes!
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT