---
sourceDocument: Australia ServiceNow AI Platform Administration
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/platform-administration

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# Add cleanup scripts

# Create cleanup scripts {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
Use cleanup scripts to automate post-clone steps or to modify data after your clone.

## Before you begin

Role required: admin

Verify that custom scripts have proper error handling to avoid issues. Without proper error handling, failing customized scripts can help prevent subsequent scripts from executing.  
Note:  
After your clone completes, you can monitor the execution status of each cleanup script on the target instance. See [Monitor cleanup script execution](https://servicenow-prod.fluidtopics.net/5iOr9INTboqWOPGfTGdKKw "Monitor the execution status of cleanup scripts after a clone and retry any scripts that encountered errors.").

## Procedure

1. Navigate to AllClone Admin ConsoleClone Home.
2. Select Configuration from the secondary navigation.
3. Select the Cleanup scripts tab.
4. Select New.
5. Enter a name for your script.
6. Select the order number for your script.
7. Check Active when your script is ready.
8. Enter your script in the Script field, and select Save.

## Disable emails {#create-cleanup-script-latest__example_afh_vpz_5gc}

To create a cleanup script to disable emails, do the following.

* Select New on the cleanup scripts tab.
* Add the name <kbd class="ph userinput">Disable emails</kbd>.
* Check Active.
* In the script field, add

      gs.setProperty("glide.email.read.active", false);gs.setProperty("glide.email.smtp.active", false);

  .
* Select Update.
{#create-cleanup-script-latest__ul_smc_cqz_5gc}

## What to do next

After your clone completes, go to the target instance to monitor cleanup script execution and retry any failed scripts. See [Monitor cleanup script execution](https://servicenow-prod.fluidtopics.net/5iOr9INTboqWOPGfTGdKKw "Monitor the execution status of cleanup scripts after a clone and retry any scripts that encountered errors.").

## Cleanup scripts (lists and forms) {#ariaid-title2}

Use cleanup scripts to modify data after your clone completes.

### Before you begin

Role required: admin  
Note:  
For current versions of the Clone Admin Console, you can monitor cleanup script execution after a clone. See [Monitor cleanup script execution](https://servicenow-prod.fluidtopics.net/5iOr9INTboqWOPGfTGdKKw "Monitor the execution status of cleanup scripts after a clone and retry any scripts that encountered errors.").

### Procedure

1. Navigate to AllInstance CloneClone DefinitionCleanup scripts.
2. Select New.
3. Select the order number for your script.
4. Check Active when your script is ready.
5. Enter your script in the Script field, and select Save.
{#post-clone-cleanup-scripts__steps_hvf_g5z_5gc}

*[\>]: and then


