Jim
Jim

Reputation: 1735

Change repository permission in TFS/VSTS/Azure DevOps with command line

I'm trying to change the permission of about 250 folders in Azure DevOps (VSTS), the source control is TFVC, and it is quite slow to change just 10 of them using the web interface.

Is there a command line tool that I can set the permission to a directory? For example, adding the A Contributors group to the directory /Release/v1/ProjectA and B Contributors group to the directory /Release/v1/ProjectB. I'm hoping this way I can just iterate through all the releases.

I was looking at TFSecurity.exe but it doesn't seem to be able to change the permission of individual folders. Or perhaps I missed something?

Upvotes: 2

Views: 349

Answers (2)

Jim
Jim

Reputation: 1735

Turned out TF.exe is the answer. For some reason I overlooked the Permission command.

The following enables inheritance for /Release/v1/ProjectA and adds a set of permission to the security group Contributors A:

.\TF.exe vc permission /inherit:yes "/Release/v1/ProjectA"
.\TF.exe vc permission /allow:"Read, PendChange, Checkin, Label, Lock, Merge" /group:"[Project]/Contributors A" "/Release/v1/ProjectA"

Upvotes: 2

adriennetacke
adriennetacke

Reputation: 1746

So, there's a Microsoft VSTS CLI in the marketplace and it has most of the basic commands you'd need. Unfortunately, when looking for permissions and repo security configuration commands, there are currently none.

Taking a look at their GitHub Repo, they do have an open issue for this exact command which would be a new feature.

Sorry!

Upvotes: 1

Related Questions