> For the complete documentation index, see [llms.txt](https://docs.docontrol.io/docontrol-user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docontrol.io/docontrol-user-guide/workflows/define-workflow-settings/action-settings/remediate/onedrive-remediation.md).

# OneDrive remediation

DoControl provides your organization with an automated way to detect and prevent unnecessary or dangerous exposure on OneDrive.&#x20;

You can implement these remediation actions  in automated workflows across OneDrive permissions and assets:

* [Remove collaborator](#remove-collaborator)
* [Remove sharing links](#remove-sharing-links)

{% hint style="warning" %}
Note the limitation in OneDrive: You cannot remove file or folder access permissions if a user has inherited permissions from a folder parent in the drive.&#x20;

**Example:** If Jack has permission to access a folder and you try to remove his permission from a specific file inside this folder, you cannot, since Jack still has permission granted by the parent folder. To remove Jack's user permission, you must remove it from the shared parent folder.
{% endhint %}

## Remove collaborator

You can remove collaborator access from a OneDrive asset for one or more collaborators. When an asset exists in a parent folder, collaborator access is removed from all assets in the folder.

1. In Workflows, select **New workflow > From scratch** or **Playbooks**.
2. Give an action name and select the **OneDrive > Added to secure link** event.
3. Define the relevant conditions, for example:
   * The `Get actor` condition is not in a specific group.
   * The `Get target` condition is not in a trusted domain.
4. From the Actions pane, select **Remediate > OneDrive > Remove collaborator.**&#x20;
5. Drag the action into the canvas and connect it to the previous action.

When the workflow is successfully run, the external user access is automatically removed from the OneDrive asset.

<figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FjMnkVDk3p61DnMJsPYTj%2FOneDrive%20remove%20collaborator.png?alt=media&amp;token=ac96a8ca-6afb-4e5b-ac3d-f2112c04c0cb" alt=""><figcaption><p>Removing an external collaborator from a OneDrive asset</p></figcaption></figure>

## Remove sharing links

You can define a workflow to remove sharing links from OneDrive assets. Using a remediation action, you can choose if you want to remove public sharing links, or organization sharing links.

DoControl's remediation action changes publicly shared assets to assets that can only be shared with collaborators (internal or external users). Asset owners will still have access. This allows your organization's security team to control asset exposure, and track individuals who change the sharing link visibility from internal to public.

#### To remove sharing links from OneDrive:

1. In your workflow, define a trigger when someone shares a file publicly in OneDrive:
   * **Event** - Anonymous link created
   * **Condition** - `Get actor` is from a specific group.
2. From the Actions pane, select **Remediate > OneDrive > Remove sharing links**.
3. Drag the action into the canvas and connect it to the previous action.
4. For Asset ID, use the default macro or type your own query.
5. Select the shared link type: public or organization.&#x20;

When the workflow is successfully run, the sharing link is automatically removed from the OneDrive asset.

<figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FbRDGFcb4kX4xpPh80eqH%2FOneDrive%20remove%20sharing.png?alt=media&amp;token=5570a6ce-e858-4519-b97a-28ec7dcaa11a" alt=""><figcaption><p>Removing a public sharing link from a OneDrive asset</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docontrol.io/docontrol-user-guide/workflows/define-workflow-settings/action-settings/remediate/onedrive-remediation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
