Remove-ProjectMember

Introduction

The Remove-ProjectMember CmdLet enables to remove people from team project groups. The parameterization can be done using a text file.

Obtain the TFS server using the Get-TFS CmdLet.

Warning : For now, the Remove-ProjectMember command does not allow the remove in WSS 3.0 and Reports Server.

Parameters

Name Description Example
-tfs TFS server obtained using Get-TFS $tfs = Get-TFS -rul http://address:8080
-projectName Project name
-userName User name COLMAR\Noham
-roles Set of roles to remove the users from Contributors;Project Administrators

Example with a text file

========================================================
Windows PowerShell
PowerShell for Team System
By Noham Choulant http://choulant.blogspot.com
========================================================


PsTFS > : $tfs = tfs colmar

PsTFS > :

PsTFS > : $content = get-content C:\Users\Administrateur\Desktop\PowerShell\users.txt

PsTFS > : $content
Noham|Contributors
Choulant|Contributors
Antonin|Contributors;Project Administrators
Noham|Project Administrators


PsTFS > : foreach ($line in $content) { $tab = $line.split("|") ; Remove-ProjectMember -tfs $tfs -ProjectName VSTS.Noham -UserName $tab[0] -Roles $tab
[1];}
Noham is remove in Contributors
Choulant is remove in Contributors
Antonin is remove in Contributors
Antonin is remove in Project Administrators
Noham is remove in Project Administrators

Last edited Jan 11, 2009 at 12:17 PM by neonp, version 3

Comments

No comments yet.