It’s been about two years since I originally created the VSTS-Tools project on GitHub. The original release had two command-line tools included with it:
- VSTS-Get – CLI to download a single file or entire folder tree from VSTS (only Git is supported at this time).
- VSTS-Keep – CLI to set (or remove) the “Retain Indefinitely” retention flag for a given build.
Not only were the tools meant to be somewhat useful (I used them then and still use them today) but they were also meant to act as yet another set of examples on how you might make use of the Visual Studio Team Services (VSTS) APIs.
Recently, I posted some examples on how to get a list of VSTS users via API calls. For the sake of completeness, I have now added this capability as another command-line utility to the VSTS-Tools project – VSTS-Users.
VSTS-Users will return a list of users for a specific account. Along with the user’s e-mail address the last date/time of system access as well as the user license type is returned. If you have a need to quickly export a list of users then you might find this tool handy.
Using the VSTS-Users CLI is pretty straightforward…
First, you must download the project from GitHub and compile it.
Next, run the VSTS-Users.exe without any parameters to see the usage help. This should show you something like this:
The only two required arguments are the account (-a) and password (-p) arguments. Calling VSTS-Users with these two arguments will generate a list of users similar to this:
In this example, the VSTS account has two users – one with a Visual Studio Enterprise subscription and another with a Basic license.
You can also add a header line and add quotes to any items with spaces. This is useful if you plan to import the list into another tool such as Microsoft Excel. For example:
To get a better understanding of how the Visual Studio solution is setup for this project, check out the post VSTS-Tools Now on GitHub.