Hmm. Don't know that I would write an app for this. Personally I would setup a rule in my firewall and white list/black list internal IPs to use the ports required by MSN or Yahoo. (I am not sure about Yahoo and MSN but, last I knew, you could configure AIM to operate on different ports)
Secondly why couldn't you just use some sort of Traffic analyzer to capture the IM traffic moving over your network?
Thirdly, I believe what Sam said is ture and that that server software should provide you with the abilities that you are looking for.
Don't try and recreate the wheel if you don't have to! ;]
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Beginning Visual C# 2008
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========