27. May 2010 19:39
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.
Use a batch file to set the permissions to all three locations at once.
TFSSecurity /g+ %1\Readers "[domain]\[user or group]" /collection:[tfs]\DefaultCollection
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"
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
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)
26. May 2010 06:53
My new TFS2010 CI builds are not running after my Gated Builds.
Customize the DefaultTemplate.xaml file to allow you to pass in the value to use for the NoCIOption property of the SyncWorkspace activity.
By default the new Gated Check In feature of TFS2010 prevents your CI builds from running. I configure my Gated Builds to be very quick and many do not run unit test. My goal with my Gated Builds is to make sure the code will compile. My CI builds are in place to make sure the code is not broken by running unit test. So after a successful Gated build I want my longer running CI build to run as well. To achieve this I customized the DefaultTemplate.xaml file to allow me to set the NoCIOption property when I create a new build definition.
To begin open the DefaultTemplate.xaml file in VS2010 and click the Arguments button at the bottom of the workflow designer to show the workflow arguments. Add a Boolean argument named “DisableCI” and set the Default value to True. This will allow the template to continue to work as it was designed.
Now let’s add a nice coat of polish on our argument. Click the ellipses next to the default value of the Metadata argument to show the “Process Parameter Metadata Editor window”. Click the Add button and enter in the following information and click OK.
Parameter Name – DisableCI
Display Name – Disable CI
Category – Advanced
Description – When set to true will disable CI builds from running after a Gated Build.
View this parameter when – Always show the parameter
Now let’s modify the activity to use the value of the argument. Navigate to the Activity labeled “Get Workspace”. It can be located under “Process > Overall Build Process > Run On Agent > Initialize Workspace > Get Workspace”. Right click the “Get Workspace” activity and select Properties from the context menu. Change the NoCIOption property from True to DisableCI.
To complete the customization simply save the file and check in the file into TFS. Now when you create/edit a build definition you will see a new “Disable CI” property you can set for the build definition. Because we selected “Always show the parameter” we will also see this property when you queue a new build as well. Simply set it to False to have your CI builds run after your Gated Builds.