Skip to main content
Box Employee
May 22, 2025 7:56 AM UTC
Question

Get User IDs using CLI

So I have set up the CLI and working with no issues.

However most commands require a user's ID. Yes I can get this using the admin console for individual users but that is not a practical solution for hundreds. And for some reason the Managed users report does not include this vital piece of information.

So, can I get a users ID using the CLI from their email address?

Or any other way to dump a list of all users with their ID, then I could use a CSV?

 

Thanks

    3 replies

    Box Employee
    May 22, 2025 7:56 AM UTC

    Hi  , hope you're doing well and welcome to the forum. Glad to see you're getting started with the CLI!

     

    To return a user ID from their email address (or even name), the argument you want to supply is --filter.

     

    $ box users --filter reba --fields id
    ----- User 700684617 -----
    Type: user
    ID: '700684617'

     For reference, the full description of this filter is:

     

    Search term to filter users on; matches prefixes of user name and login fields

     

    From https://github.com/box/boxcli/blob/master/docs/users.md

     

    Hope that helps!

    Translate
    Box Employee
    May 22, 2025 7:56 AM UTC

    Thanks Jason

    Translate
    Box Employee
    May 22, 2025 7:56 AM UTC

    , please include this in the CLI documentation as an example for box users:get [ID].

     

    I would of had no way of knowing this without searching. In fact the CLI documentation needs be overhauled. It's one of the most unfriendly documentation for users. Even searching for filter help doesn't show this.

    Translate