September 2010
M T W T F S S
« Aug    
 12345
6789101112
13141516171819
20212223242526
27282930  

Archive for the 'Networking' Category

17
Feb

Quick tool to export information out of Active Directory

I had a task to rip all the email addresses and usernames out of my Active Directory for our client extranet. I thought what a pain, thinking I was going to have to write some app that will use LDAP and query to get Directory objects that I could rip information from. But ta da I found this little diddy that gave me what I wanted. Its not powerfull and is limited to only a few fields, but they are important fields that we all need. Enjoy.

http://confluence.atlassian.com/display/JIRAEXT/How+to+export+a+list+of+users+from+Active+Directory

28
Dec

TFS Proxy server in non trusted remote domain

I ran into a problem that I am sure more people than me run into. I had to install TFS into a remote office of developers that are contracted. To make it worse the remote office is 5000 miles away. Now since the developers are not employed by us I have the choice:

1. Leave them in their own domain and figure out how to make the remote domain work with TFS.
or

2. Connect their AD to ours and deal with the trust issues.

I decided on #1. Now I am a network guy so setting up the VPN between the two offices was a piece of cake. I dropped a WatchGuard Edge onto the remote next work and connected it to our home office for a secure VPN.

Now for the fun part. The proxy server connects to the main TFS server using the Identity of the Application Pool for the TFS Proxy Server Web Site. Since the remote AD and the TFS AD are not in the same domain, they can not authenticate to each other. But there is a hack.

In this scenario we will use 3 devices, Proxy server (PServer), TFS server (TServer), and remote client (client). There are two domains HomeAD (TFS server domain) and RemoteAD (Proxy and client domain).

TServer is in HomeAD
PServer is in RemoteAD
client is in RemoteAD

The hack is to create a local user on TServer, we will use proxyUser with a password or proxy123. Make that user a local admin and add that user to TFS.

In visual studio, in Team Explorer, right click on the TFS server (TServer), Team Foundation Server Settings, Group Membership. Click on Team Foundation Administrators then the properties button. Select the ‘Window User or Group’ radio button then Add. Add proxyUser and select OK. The user proxyUser is now an Administrator for the TFS server.

Now on the remote domain, RemoteAD, add the user proxyUser with the same password, proxy123.

On the TFS Proxy server open IIS. Locate the App Pool Team Foundation Server and open it. On the identity tab set the logon user to RemoteAD/proxyUser with proxy123 as the password. Run iisreset to reset the web site. Goto http://localhost:8081/VersionControl/v1.0/ProxyStatistics.asmx. Click Invoke. If you get XML that lists number of file fetched, files missed, etc.. then the link to the main TFS is up.

The client is simple. The client’s machine and username are in the RemoteAD domain. When the user connects to the TFS Proxy server (PServer), it will use the users login for the RemoteAD. When the user connects to the real TFS server (TServer) for check-ins and to get the security token, they will use their AD account that has been set up in HomeAD.

So the path goes as follows:

User Ted connects to the Main TFS using an account created for him in HomeAD, HomeAD\Ted2. He gets a token from that TFS and give it to the Proxy using his local AD creds, RemoteAD\Ted. He gets files from the Proxy, who gets the files from the Main TFS using the creds RemoteAD\proxyUser. That login gets translated into TServer\proxyUser for authentication. When Ted checks in, he uses the HomeAD\Ted2 login again.

Remote TFS

28
Nov

TFS in a remote location using TFS proxy 2008.

Microsoft Team Foundation Server (TFS) is a great tool, it really is. TFS is highly available, robust, centralized, versioned and easily recoverable. At my company, we use it for everything. Every project, every solution we have is on it. But it has an issue, well its a flaw. You have to be connected to it all the time. If you aren’t you get lots of wonderful errors and alerts that are soon followed by more. Now put it in todays world where programmers aren’t all located in the same building, state or even country. Connecting to the Team Foundation Server now gets a little more complicated and problematic. What we all want is a TFS in every location that is syncing up with a master (peer to server) or each other (peer to peer). Microsoft kind of fixed this, and I mean ‘kind of’.

When Microsoft released TFS they also released Team Foundation Server Proxy (TFSP). TFSP allows you grab source files from the remote server, but not check them in. You still have to check them in directly to the master TFS server farm. That really irritates me. If you can go threw the work of getting the files from the server why not add a system to allow the data to operate bi-directionally. But maybe the next version will give me that :)

So lets get down to the install.

First thing you need to know is that TFSP has to be install on Server 2003 server. I have tried to install it on XP for a remote location on a budget, but that is a no go.

On your Server 2003 open your TFS media and select Team Foundation Server Proxy option.
TFSP1

After selecting your file locations you have to enter your ‘Service Logon Account’. This is the account that is used as the service account on the master TFS server. If you look at the services on the TFS server you will find it as the logon account for Visual Studio Team Foundation Server Task Scheduler.

TFSP3

Enter the same user and password in the form .

TFSP2

The rest of the install is spent installing .NET 3.5 and the TFSP. After the install is done you need to edit the Proxy.Config. The config is located at %ProgramFiles%\Microsoft Visual Studio 2005 Team Foundation Server\Web Services\VersionControlProxy\proxy.config. When reading any of the posts on the net, you will find most of them for TFSP 2005. When installing it during 2008 beta 2 I ran into a problem of it not being able to connect to the master TFS server. After a lot of testing and some docs from MSDN I found the answer. You can find my problem post here . The important information is that in 2008 the server web path has changed, highlighted below.

<?xml version=”1.0″ encoding=”utf-8″?>
<ProxyConfiguration
xmlns:xsd=”http://www.w3.org/2001/XMLSchema
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance“>
<Servers>
<Server>
<Uri>http://REAL_TFS_SERVER:8080</Uri>
</Server>
</Servers>

<!– Proxy file cache root folder –>
<CacheRoot>C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\VersionControlProxy\Data</CacheRoot>

<CacheLimitPolicy>
<!– Cache limit expressed as percentage of disk space –>
<PercentageBasedPolicy>75</PercentageBasedPolicy>

<!– Cache limit expressed as MB –>
<!– <FixedSizeBasedPolicy></FixedSizeBasedPolicy> –>
</CacheLimitPolicy>

<!– Percentage of cache size that needs to be freed up, on hitting cache limit –>
<CacheDeletionPercent>10</CacheDeletionPercent>

<!– Indicates how often (number of hours) the proxy statistics information should be persisted to a file–>
<StatisticsPersistTime>1</StatisticsPersistTime>

<ReaderChunkSize>1048576</ReaderChunkSize>
<WriterChunkSize>1048576</WriterChunkSize>
</ProxyConfiguration>

Now that the server is install and connecting to the master farm we can configure the client to access the proxy to get files. You will still need to configure your TFS client as normal because remember you are checking in directly to the master. And when you ‘Get Latest’, what you are actually doing in connecting to the master, getting a certificate from the master that describes what you have access to and then you give that certificate to the proxy. Kind of a cheap way to do security, but thats what they did :(. Things can be improved here. On the client in Visual Studio goto Tools > Options > Source Control. Select the Use Proxy Server checkbox, enter your TFSP server name and enter 8081 for the port. Remember the TFS server port by default is 8080 and TFSP is 8081. Once that is done, select a project and do a ‘Get Latest’. You will see that your files are now in the Cache folder you specified during the install, encrypted.

TFSP4

Remember that with TFSP you can use one server to proxy many other TFS servers. If you notice in the cache folder, the first folder is a GUID. That is the server ID. If you add a lot of servers, they will all be different GUIDs in that folder.

Enjoy TFS and lets hope MS fixes some of those short comings.

Chris