Friday, December 18, 2009

Deleting a Windows Account on a TFS

My question was: If I delete a user's Windows Account, will it be automatically removed from TFS, too? Since I couldn't find the answer on Google, I thought I'll just post the answer here.

The answer is: NO YES

You have to remove the user account from all TFS Groups and Projects, otherwise it will show up in the Assigned To field.
The easiest way I know is: in Team Explorer, right click the root of the server -> Team Foundation Server Settings -> Group Membership and search for a group you surely know that the user was part of. Double-click the group, and double-click the person. A window will show up with all the groups the user is member of. Print screen-it to have this info in the clipboard and remove the user from each group.
You must also remove the user manually from the Project Portals. Check again the clipboard to see in which portals might the user be. Open each affected Project Portal, go to Site Actions (on the right), choose Site Settings, People and Groups and delete the guy.
The interesting thing is that from the Reports Sites the user will be removed automatically, no work to do there :-)

UPDATE: Lately I had an email discussion with a developer of the TFS Administration Tool and he revealed me that TFS hourly syncs with the identity stores and if a user GUID cannot be resolved, it will mark it as deleted. That means, it's enough to delete the user from Windows and Sharepoint. From TFS and SQL Reporting the user will be automatically removed. I have not tested this though.

Friday, December 4, 2009

Installing the Geo::IP plug-in for AWStats when ActivePerl distribution is 5.10.x

There are lots of tutorials how to install the Geo::IP::PurePerl plug-in for AWStats, but they specify ppm packages only for ActivePerl versions 5.6 and 5.8. I had to dig google a bit to find the repositories for ActivePerl 5.10. I found the Geo-IP-PurePerl packages here.

To install the x86 Perl Package:
C:\>ppm install http://ppm4.activestate.com/MSWin32-x86/5.10/1000/B/BO/BORISZ/Geo-IP-PurePerl-1.24.ppmx
Add the following line to awstats.yourwebsite.conf file:
LoadPlugin="geoip GEOIP_STANDARD C:\Program Files\GeoIP\GeoIP.dat"
After this, create a directory C:\Program Files\GeoIP and extract here the latest country database file, GeoIP.dat, from here. You have to grant the IUSR_ account read access to this file, otherwise you'll get the error message:
Error: Plugin init for plugin 'geoip' failed with return code: Error opening c:\Program Files\GeoIP\GeoIP.dat at C:/Perl/site/lib/Geo/IP/PurePerl.pm line 183. (A module required by plugin might be missing).
Setup ('C:\Inetpub\wwwroot\AWStats\cgi-bin/awstats.yourwebsite.conf' file, web server or permissions) may be wrong.

Making AWStats work with default IIS logging.

By default, IIS logs the following:
#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status
This is nice, but bytes sent is not logged by default by IIS, although AWStats needs this and will give you the error message:
Error: Your personalized LogFormat does not include all fields required by AWStats (Add %bytesd in your LogFormat string).
Fortunately, sc-substatus is always 0 and it's logged, so at least you can see statistics for page hits, operating systems, browsers... except traffic. The LogFormat for the awstats.YourSite.conf file should be the following:
LogFormat = %time2  %other %other %method %url %query %other %logname %host %ua %code %bytesd %other
NOTE: you have to import log data in chronological order before you start scheduling awstats updates, so it's a good idea to make a batch file to do this for you:
awstats.pl -config=DefaultWebSite -update -logfile=c:\WINDOWS\system32\Logfiles\W3SVC1930027649\ex091124.log
awstats.pl -config=DefaultWebSite -update -logfile=c:\WINDOWS\system32\Logfiles\W3SVC1930027649\ex091125.log
awstats.pl -config=DefaultWebSite -update -logfile=c:\WINDOWS\system32\Logfiles\W3SVC1930027649\ex091126.log