CLI Folder Collaboration+Move+Delete for 100+ Users
回答済み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!
-
正式なコメント
Hello,
The docs section of our CLI SDK library has tons of examples of commands you are looking to write. We also have a quick start on our developer site to help you get started. Beyond that, I would recommend reaching out to Box Consulting for more enablement or custom scripting.
Thanks,
Alex, Box Developer Advocate
コメントアクション -
I was able to refine it down to the following command, doing so eliminates most of the difficulty.
box users:move-root-content --bulk-file-path=~/bulk_move_root_content.csv
This CSV has two columns, USERID and NEWUSERID. I already tested it successfully with a single entry.
The hurdle now is to export the USERID for all users that haven’t logged in within 90 days. The Web GUI Reports unfortunately don’t include USERID, and the CLI doesn’t seem to be able to filter for last logon.
Worst case scenario I can attempt a crude spreadsheet comparison and join the USERID info from the CLI export to the GUI report – but I would like to keep it as precise as possible. Anyone tackle this before?
サインインしてコメントを残してください。
コメント
2件のコメント