> 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/sharepoint-remediation.md).

# SharePoint remediation

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

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

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

{% hint style="warning" %}
Note the limitation in SharePoint: 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 <a href="#remove-collaborator" id="remove-collaborator"></a>

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

For example, if a 3rd party shares a SharePoint asset with a 4th party, you can use an automated workflow from a DoControl playbook to remove the external collaborators.

**To remove a collaborator from a SharePoint asset:**

1. In Workflows, select **New workflow > From scratch** or **Playbooks**.
2. Give an action name and select the relevant SharePoint event, such as Added to secure link.
3. Define the relevant conditions, for example:
   * The `Get actor` condition does not contain your organizational domain: @yourdomain.com.
   * The `Get target` condition does not contain your organizational domain: @yourdomain.com.
4. From the Actions pane, select **Remediate > SharePoint > Remove collaborator.**&#x20;
5. Drag the action into the canvas and connect it to the previous action.
6. For Asset ID, enter the macro for `Get asset ID` or type your own query.
7. For target emails, enter the macro for `Get target` or type your own query.\
   \
   When the workflow is successfully run, the external user access is automatically removed from the SharePoint asset.

<figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FP9rEP32CRbx8bMwBkd4A%2FSharePoint%20remove%20collab.png?alt=media&amp;token=15485301-2f3f-406f-87f9-d7d4a82f3dce" alt=""><figcaption><p>Removing an external collaborator from a SharePoint asset</p></figcaption></figure>

## Remove sharing links <a href="#remove-sharing-links" id="remove-sharing-links"></a>

In SharePoint, an asset can be shared either publicly or with the entire organization. Using a remediation action in a workflow, you can choose if you want to remove public sharing links, or organization sharing links from SharePoint asset.

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 **SharePoint**:

1. In your workflow, define a trigger when someone shares a file publicly in SharePoint. For example:
   * **Event** - Anonymous link created
   * **Condition** - `Get actor` is from a specific group.
2. From the Actions pane, select **Remediate > SharePoint > Remove sharing links**.
3. Drag the action into the canvas and connect it to the previous action.
4. For Asset ID, enter the macro for `Get asset ID` 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 SharePoint asset.

<figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2Fe5hMIatpZttaEtR5QXn9%2FSharePoint%20Remove%20sharing%20links.png?alt=media&amp;token=fc8224ad-7cdb-4b4d-bc8f-9bc174273b2b" alt=""><figcaption><p>Define a workflow to remove a public link from a SharePoint 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/sharepoint-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.
