TFS, Reporting Server and SharePoint security from command line

by Donovan Brown 27. May 2010 19:39

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)

Tags: , , , , ,

Work

About the author

My name is Donovan Brown and I am a process consultant for Imaginet with a background in application development.  I also run one of the Nation’s fastest growing online registration sites for motorsports events DLBRacing.com.  When I am not writing software I race cars for fun.  DLBRacing.com has given me the opportunity to combine my two passions writing software and racing cars.

AdSense

Month List

AdSense