---
title: Automate removal of shares on files after X days
description: "Automatically take action on file permissions after a certain period of time has passed. GAT+ provides this option via a **Scheduled** feature Here is a common scenario: **Remove public file permissions, if the file has been shared out (outside the…"
url: "https://gatlabs.com/knowledge/tech-tips/automate-removal-of-shares-on-files-after-x-days/"
updated: "2024-06-11"
category: DLP (Data Loss Prevention)
tags:
  - GAT+
---

# Automate removal of shares on files after X days

Automatically take action on file permissions after a certain period of time has passed. GAT+ provides this option via a **Scheduled** feature

Here is a common scenario: **Remove public file permissions, if the file has been shared out (outside the organization) longer than X days**

- Remove public permission (Shared out) longer than X days
  - Essentially placing an expiry date on the sharing permissions.

[https://www.youtube.com/embed/THzk3dd9UwM?feature=oembed&color=red&rel=0&controls=1&start=&end=&fs=0&iv_load_policy=0&autoplay=0&mute=0&modestbranding=0&cc_load_policy=1&playsinline=1](https://www.youtube.com/embed/THzk3dd9UwM?feature=oembed&color=red&rel=0&controls=1&start=&end=&fs=0&iv_load_policy=0&autoplay=0&mute=0&modestbranding=0&cc_load_policy=1&playsinline=1)

## Steps to configure these scheduled actions:

### Access to GAT+ - Drive Audit

Navigate to **GAT+ → Drive → Files → Apply custom filter**

![](https://gatlabs.com/wp-content/uploads/2020/07/screenshot-uk.generalaudittool.com-2021.01.29-13_05_50.png)

### Apply filter

Apply the following condition (search parameters): ***Sharing flag equals Shared Out**.*

Next, add a rule to specify when these files have last been accessed: ***Last accessed (relative) Older than X days.***

> ***Last accessed***; describes when a file was last time 'used' by internal or external user. File could have been added to folder, created, deleted, downloaded, edited, moved, previewed, printed, removed from folder, renamed, unthrashed, thrashed, uploaded or viewed
>
>
>
> ***Updated***is taken directly from the file metadata in the API, "Last time this file was modified by anyone"

Enter a suitable name for the Report.

![](https://n.gatlabs.com/wp-content/uploads/2021/01/olderxdaysAug2021.png)

### Schedule Report

- Click on the **Scheduled** check box, more options will be displayed.
- Set **Occurrence** time (as an example) - every weekend
- Check-mark to be **Enabled **
- Click on **Apply & Schedule**

![](https://gatlabs.com/wp-content/uploads/2020/07/screenshot-gs.generalaudittool.com-2020.07.22-18_00_06.png)

The report will be saved and Scheduled

### Access the report

Navigate to **GAT+ → Configuration → Scheduled reports **

![](https://gatlabs.com/knowledge/wp-content/uploads/2021/12/2022-06-27-11_47_28-Window.png)

A list of all the **Scheduled reports**will be displayed.

Action can be taken for each of the reports under **Actions**

- Pen icon - edit the report
- X icon  - delete the scheduled report
- **+ sign **- Job action edit - set up an action to be taken on the Scheduled report

![](https://gatlabs.com/wp-content/uploads/2020/07/screenshot-gs.generalaudittool.com-2020.07.22-18_05_07.png)

### Schedule action to be taken

When the + sign is selected, a new window called **Scheduled job details**will be displayed.

Fill in the details and set the action to be taken.

- Click on **External**
- Select **Remove Only the following External Shares **
  - **Shares to Remove** - enter the permission you want to **remove**: as an example (**everyone** and **everyone with link**)
    - **Additionally - Only shared -**Enter the number of days since the File was shared out

> Note: Only files with the **last recorded Shared out** date will be affected.

![](https://gatlabs.com/knowledge/wp-content/uploads/2022/06/External-shares-4.png)

- Give time frame

**Only shared 30 days ago **means files that have the shares (everyone, everyone with link) that have been **Shared more > than 30 days ago**, only **those files will be affected** and **Shares removed.**

Under Configure

- **Status** - Set to **Enable** or disable
- **Report only** - Set report only and take **NO action**
- **Notify local users** - Set to notify or not local users
- Save settings - click on the button to save the settings (Scheduled job).

![](https://gatlabs.com/wp-content/uploads/2020/07/screenshot-uk.generalaudittool.com-2021.01.29-14_34_46.png)

### Overall result

When the Report above is Scheduled and the Job is set to run weekly.

- The report for Files Shared out - will be generated on a weekly basis (as selected above)
- Based on the selected action, the Files that are Shared Out - longer than the 30 days selected, will be **Removed**
