Welcome to the new Box Support website. Check out all the details here on what’s changed.

Accidental Sync - Deleted Files re-uploaded

Answered
New post

Comments

5 comments

  • Official comment
    Alex Novotny

    If you have a list of the ids of the files in a csv file, you should be able to create a simple powershell script with our CLI to re-delete the files

    Hope this helps, 

    Alex, Box Developer Advocate

    Comment actions Permalink
  • Jordan Tabbert

    Alex, thank you for the response!

    I was able to connect to my Box environment using the CLI. To test, I figured I would delete a file by itself before going full-scale. But when I try, I get a 404 error:

    Am I doing something wrong? I ran a report to find these affected files, and I assume Affected ID is what I needed:

    I'm definitely in our Box, if I run a simple command like "box users" all my users will appear:

    Any info helps. Thanks again!

    0
    Comment actions Permalink
  • Alex Novotny

    Hello!

    This is probably because the service account that got created for the CLI is not collaborated into the content you are trying to delete... so it can't find the files. You will want to make as-user calls with a user id that owns the content. 

    Hope this helps, 

    Alex, Box Developer Advocate

    1
    Comment actions Permalink
  • Jordan Tabbert

    Alex, thanks for the follow up!

    I was able to get it working by sharing my highest level folders with my service account:

    Once I did that, the CLI command is running as it should:

    0
    Comment actions Permalink
  • Alex Novotny

    Yes! You can also collaborate the service account into the content. Sometimes though it's not easy to do that in all the content at once like your folder structure is architected. Glad you got your problem solved! 

    1
    Comment actions Permalink

Post is closed for comments.