Jump to content
Sign in to follow this  

Auto Deletion Script Help

Recommended Posts

Hi All,

I am relatively inexperienced in scripts but need assistance with creating a script to do the following:

For our clients, we need to remove terminated user data after 30 days. We thought it best to create a folder that we can move their profile to, and then have a script set up to run every 30 days to remove anything that has been in that folder for more than 30 days. We would call that folder something like "Terminated User Data". 


Any guidance on this or suggestions are much appreciated! Thank you!


Share this post

Link to post
Share on other sites

My recommendation would be to build a Powershell script that handles the deletion, since that can do more complex checks like when the files/folders were last modified, etc. Use your Automate script to execute the Powershell script (once a week? nightly? whenever you like, if all of the date checking is in Powershell). Have it use Write-Output to dump any relevant information to the results variable (use the Execute Script function in Automate). You could have the script run a simple powershell query first to see if there are any applicable files and exit if not, create a ticket (if desired), etc.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this