Hi! I am fresh to the CLI - looking to create a few commands that will archive data from inactive users, and then delete those users.
- Export a list of user IDs for all users that have not logged in within 90 days (the GUI generated reports I ran do not include user IDs)
- Export a list of all root level folder IDs owned by those users (do not touch content shared with them)
- Run a folders:collaborations:add for those folders to add a single service account as co-owner, example: box folders:collaborations:add --bulk-file-path=folders.csv --role=co-owner --user-id=123456789
- Run a users:delete for those inactive users, example: box users:delete --bulk-file-path=users.csv
I thought about moving their root folders into parent folders named after their usernames so the data stays organized within the service account, but I'm not sure how this would affect existing co-owners.
Thanks in advance for your 2 cents!
Please sign in to leave a comment.