TFS, Reporting Server and SharePoint security from command line

Problem:

I have to perform a migration many teams over to TFS and assign permissions to TFS, Report Server and SharePoint for dozens of Team Projects.

Solution:

Use a batch file to set the permissions to all three locations at once.

Code:

TFS

TFSSecurity /g+ %1\Readers "[domain]\[user or group]" /collection:[tfs]\DefaultCollection

Report Server

rs -i security.rss -s http://localhost/reportserver -v userName="[domain]\[user or group]" -v roleName="Browser" -v itemPath="/TfsReports/DefaultCollection/%1" -v keepCurrentPolicy="True"

Sharepoint

stsadm -o adduser -url http://[tfs]/sites/DefaultCollection/%1/ -userlogin "[domain]\[user or group]" -role Contribute -username "Development Team" -useremail "developmentteam@[domain].com"

·         %1 is a parameter to a batch file. The value passed into the batch file is the Team Project you want administer security over.

·         All username or groups are in the domain\username format so replace [domain] with your domain and [user or group] with the username or group you wish to assign permissions too.

·         [tfs] is the name of your TFS AT Server

Explanation:

Be sure that rs.exe, stsadm.exe and TFSSecurity.exe are on the machine you execute these commands from and are in the path.  You must run the command prompt as Administer for the stsadm commands to succeed.  

security.rss (2.47 kb)

Add comment

Loading