Applies to: Office 365 Exchange Online


When attaching a file from a OneDrive location to an email in Outlook on the web (OWA), it gives you two options:
  1. Sharing as a OneDrive link.
  2. Attaching as a copy.

It's easy for a user to pick one and set that choice as the default option for the future sharings in the related prompt as seen in the image above.

There might also be cases where you need to set the default sharing preference as "attach as a copy" and leave OneDrive-sharing out for reasons like:
  • Users aren't allowed to share files in the cloud as linked attachments due to corporate policies.
  • A user raises a specific request providing a good business justification.
  • You simply don't want OneDrive shares to be created for every attachment that is meant to be sent with an email.
It can be done directly from the Mail settings in Outlook on the web (OWA) of the corresponding user(s):

However, if this change is supposed to be applied for a bunch of users, you'd need to handle things in bulk and remotely instead of asking users to take action themselves or helping them do so one by one.


To set Attachment Sharing Preference as "Attach as a Copy" in OWA for any users, you can follow the steps below in Exchange Online Powershell:

1- Create a new OWA Mailbox Policy and give it a name like "OwaMailboxPolicy-OneDriveDisabled":

New-OwaMailboxPolicy -Name "OwaMailboxPolicy-OneDriveDisabled"

2- Disable "ReferenceAttachmentsEnabled" for the new policy:

Set-OwaMailboxPolicy -Identity "OwaMailboxPolicy-OneDriveDisabled" -ReferenceAttachmentsEnabled $false

3- Assign the new policy to a pilot user for testing:

Set-CASMailbox -Identity -OwaMailboxPolicy "OwaMailboxPolicy-OneDriveDisabled"

4- The changes might take some time (up to a few hours) to be effective. After waiting for a while, test it out with the pilot user.

5- Once you make sure that you've done everything correctly and it works as desired, assign the new policy to all corresponding users.

If it's supposed to be in effect for all users in the organization without any exceptions, you can go with either of the following options:
  • Assign the new policy to every user using the cmdlet below:
    Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox | foreach {Set-CasMailbox -Identity $_.MicrosoftOnlineServicesID -OwaMailboxPolicy "OwaMailboxPolicy-OneDriveDisabled"}
  • Update the default OWA policy (OwaMailboxPolicy-Default) using the cmdlet in Step 2 and disable "ReferenceAttachmentsEnabled" for it. Personally I wouldn't recommend this, because having a default policy untouched can be a life-saver in case of any corruptions with the custom ones.
If you want to take the action back at some point, you can simply run the cmdlet in Step 2 and set "ReferenceAttachmentsEnabled" as $true instead of $false this time. As an easier approach, you can also assign the default policy back to the users.

Other Languages

See Also