Forum Discussion
Hello ptaylor,
Yes I agree, and I managed to make it look like a real JSON (and finally converting it successfully) using a few string replacements, including some regex.
It looks not really clean to me, and I was hoping to fix the format in a simpler way. But it works now, I guess that's the most important... 🙂
Thanks a lot for your reply, have a good rest of your day!
JF
I'm looking to see if I have a pipeline for this...(think I may have broken it up into several small ones by asset type.)
Short term path, in classic Manager, you can use Asset Search to see where they are working to get a list of projects to work with, you can have a pipeline to find and delete assets by project (searching for their ID using everything before the @ seems to work best for me).
Some things to keep in mind when if you want to build your own pipeline:
- This would best be used on non-admins users that have left since admins often create shared assets and own those assets by default. You don't want to accidentally delete someone else's project.
- You would need to delete their assets before you remove them. Once they are deleted, any outstanding assets are reassigned to the admin that removed them.
- The SnapLogic List Snap is your friend. To find files, use SnapLogic List set to All Assets (with a path to their project to lessen the load), followed by a Filter set to "$asset_type=='File' "
It's not snaplogic related files. This is part of an identity management system. When an employee leaves, all their personal files and folders need to be deleted off a windows server. This was done before with Powershell scripts, but now converting to Snaplogic pipelines.
The FileDelete snap can indeed be utilised to delete files or empty directories.
FYI - If the file is a symbolic link, only the symbolic link itself, not the final target of the link, will be deleted. Moreover, if the file is a directory, the FileDelete snap will delete it only when the directory is empty.
On some operating systems it may not be possible to remove a file/directory when it is open and in use by this Java virtual machine or other programs.
- bojanvelevski2 years agoValued Contributor
Hi wpenfold,
You can develop a solution that lists all folders and files under a certain directory. At the end, simply use the File Delete snap.
Regards,
Bojan
- darshthakkar3 months agoValued Contributor
wpenfold - I would rely on Powershell as there is a lot of possibility there. You still would have to define your ps1 files but that should be fairly straightforward considering you have unique identifiers like employee_Id, employee_code, etc.
While defining your .ps1 file, you can include code that lists all the files and asks for confirmation before performing delete operation. I would urge you to test in a TestFolder and then scale it up.
Thanks.
Best Regards,
Darsh