msmcpeake 8 Posted October 17, 2020 Share Posted October 17, 2020 Here's a short script I wrote in Powershell to delete recording over 45 days old. You just need to set the path and how many days you want it to go back. It can be a network drive or mapped drive depending on what you use. $Path = "\\192.168.1.240\Defaul1\netadmin\Media Server\Recordings" $Daysback = "-45" $CurrentDate = Get-Date $DatetoDelete = $CurrentDate.AddDays($Daysback) Get-ChildItem $Path -Recurse | Where-Object { $_.LastWriteTime -lt $DatetoDelete } | Remove-Item -Recurse -Verbose I have it set to run as a task every 24 hours. Recordings_Cleanup.ps1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now