Ability to prune Upload-Files

Any way for me to prune old uploaded files in Syncro? I am going to being uploading some files regularly from all the Assets and need to be able to delete them programmatically. I am not going into every asset and deleting stuff by hand and there is no reason to have years old data attached to the asset.

# This will upload the file to Syncro and attach it to the Asset.
Upload-File -FilePath "C:\temp\screenshot.jpg"

This is another script where a randomized start time would be welcome. I have already bounced off the Syncro rate limiter.

I wish I had a reference for this, but I sort of think I remember there being some sort of a file limit on assets. Hopefully that method works for you but as far as I know there is no way to manage files programmatically. Your best bet would be checking the api docs

I believe Ticket Attachments are available on the API, but Asset Attachments aren’t. There isn’t any great way to manage them beyond manually deleting them. This one would be a feature request.

If these files are text you could use custom fields or tickets instead. Or just retrieve the file from the asset manually via background tools on the likely rare occasion it’s needed.

The idea was still taking form when I posted this question. The current idea was to post wiztree disk space usage pics monthly. Having a few historical images would be nice to compare. Here is a small 640x480 example from a test vm.

wiztreeimage

Is there a way to generate an image like that using a script?

something regularly updated I’d probably try to figure out a way to use a text field, and just pull the actual disk usage when needed.

Yes, wiztree can do a csv. I started the with the community script. Have a look there.

We use the file upload option in our scripts to store files for historical research and auditing. We’ve hit the 99 file max and cannot upload any more files/images. I would like to know if there is a way to archive based on the date/age of the uploaded file without losing the data. In addition, a bulk method of removing files that are not necessary rather than individually removing each would be nice as well.

Our scenario is similar to the original post here. And suggestions are that you can attach to tickets instead of the actual asset. I like the idea but do not know how it would work.

Scenario: I’ve got a ticket open and a Syncro Asset associated with it. I have a pre-defined script that needs to run to resolve the issue. I open the Asset, schedule/run the script, and need the results to be assigned to the ticket at hand and the associated files generated by the script as well. Without editing every script to add the exact ticket ID or #, how do you do this?

I solved this by uploading to my own S3 bucket with keys that have write only, no read, no list access.

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module -Name AWSPowerShell -Force        
Set-AWSCredential -AccessKey $AccessKey -SecretKey $SecretKey
Write-S3Object -BucketName $Bucket -File $fullfilename -Key $keyfilename -EndpointUrl $Endpoint -Region $Region
1 Like