> 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/risk-management/threat-model-coverage/personal-account-sharing/sharepoint-playbooks-for-personal-account-sharing.md).

# SharePoint playbooks for personal account sharing

To mitigate the risk associated with personal account sharing in SharePoint, you can define automated workflows for these use cases:&#x20;

## Remove sharing with personal email

When someone shares a file from SharePoint with their personal email account (as verified by the HRIS app), both the actor and manager are notified, and the external collaborators are automatically removed.

1. In Workflows, select **Playbooks**.

2. Filter the playbooks according to the SharePoint app, and select the **Remove sharing with personal email** playbook.

3. Give an action name.<br>

   <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FXopFqecC7pT0eU9XsmiU%2FPlaybook%20personal%20SharePoint.png?alt=media&amp;token=a13d9c40-f3cb-4343-82fc-774705385ebf" alt=""><figcaption></figcaption></figure>

4. Under the **Added to secure link** event, define the relevant conditions:

   * The `Get target` condition is in your keyword list of `private email domains`.\
     To define your organization's list of private email domains, see [lexical lists](/docontrol-user-guide/system-management/settings/lexical-lists.md).
   * The `Get actor` condition is in a [trusted domain](/docontrol-user-guide/saas-data-monitoring/inventory/inventory-domains.md#trusted-domains).
   * Add any relevant conditions.

5. In the **Get user metadata** step:
   * Select the HRIS app from which to retrieve user data, such as HiBob.
   * Verify that the user email contains the `Get actor` macro.

6. Customize a **Conditional** step to check if the collaborator has the personal email of the actor, according to records in your organization's HR app:
   * If **False**, end the workflow.
   * If **True**, customize the **Notify by email** step to notify the actor who shared the file, and explain that sharing permissions will be removed:\
     `Hi, You shared a file named <file name>  with <target email>  which was identified as your personal email.`

     `The file sharing will be removed immediately, as this sharing violates our organizational policy.`

7. Customize the **Notify by email** step to notify the actor's manager that the actor shared a file with their personal email: \
   `Your team member, <actor name>, shared a file named <file name> with <target name>. This email was identified as the actor's personal email.`

   `The file sharing will be removed immediately, as this sharing violates our organizational policy.`

   `An email was sent to the actor notifying them that the file sharing will be removed.`

8. Under the **Remove collaborator** action, make sure the `Get asset ID` and `Get target` macros are selected.

The external collaborators are automatically removed from the SharePoint asset.


---

# 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/risk-management/threat-model-coverage/personal-account-sharing/sharepoint-playbooks-for-personal-account-sharing.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.
