Creating Dymanic Web Service References in Visual Studio .NET 2003

Found the following samples that help you create a web service in a .NET project that is Dynamic. I got tired of having to create versions of my project every time we changed the web service URL. Especially as we moved from Dev, Test, Prod. The binaries were getting confusing.

Dynamically Change Webservice URL

  1. register a webservice ( I then changed the folder to the default name of the web service i wanted)
  2. right click the webservice change URL Behavior to Dynamic
  3. click the 'show all files' icon in solution explorer
  4. in the web reference edit the Reference.cs file
  5. change class constructor such that you add the parts in bold. Note some comments are in bold.)

public wsMLA(string urlSetting) {
// string urlSetting = System.Configuration.ConfigurationSettings.AppSettings[""];
if ((urlSetting != null)) {
this.Url = string.Concat(urlSetting, "");
else {
this.Url = "";

Then you can set the URL when you instantiate the class.

Thanks goes to the folks at


Searching all of Active Directory via C# .NET

I've been pouring over ways to search AD for properties, and users. And had resulted into querying each tree looking for items. By moving to a model where you determine the GC, and query it. It searches in all trees in the forest.

DirectoryEntry entry = new DirectoryEntry("GC:");
IEnumerator ie = entry.Children.GetEnumerator();
entry = (DirectoryEntry)ie.Current;
searcher = new DirectorySearcher(entry);
searcher.Filter = " ((proxyAddresses=" + smtpProxy + "))";

With the value of smtpProxy being something like "smtp:username*" will return all objects in the forest that have email proxyAddresses that start with that username. Very usefull when trying to quickly determine if a user already is using an email alias before adding it (since AD will let you add duplicates of this property).

Userfull Links.

Using System.DirectoryServices to Search the Active Directory

DirectorySearcher.SearchRoot Property

Google Search Words: GC: DirectorySearcher DirectoryEntry

Things to add to your .NET project

using System.DirectoryServices;
using System.Collections;


More software to remove spyware and viruses

Microsoft Windows Malicious Software Removal Tool Microsoft is releasing an updated version of the Microsoft Windows Malicious Software Removal Tool on Windows Update and the Download Center. Note that this tool will NOT be distributed using Software Update Services (SUS). Information on the Microsoft Windows Malicious Software Removal Tool can be located here:


20 Ways To Maintain A Healthy Level of Insanity

20 Ways To Maintain A Healthy Level of Insanity

1. At Lunch Time, Sit In Your Parked Car With Sunglasses on and Point A Hair Dryer At Passing Cars. See If They Slow Down.

2. Page Yourself Over The Intercom. Don't Disguise Your Voice.

3. Every Time Someone Asks You To Do Something, Ask If They Want Fries With That.

4. Put Your Garbage Can On Your Desk And Label It "In."

5. Put Decaf In The Coffee Maker For 3 Weeks. Once Everyone Has Gotten Over Their Caffeine Addictions, Switch To Espresso.

6. In The Memo Field Of All Your Checks, Write "For Sexual Favors"

7. Finish All Your Sentences With "In Accordance With The Prophecy."

8 Don't Use Any Punctuation

9. As Often As Possible, Skip Rather Than Walk.

10. Ask People What Sex They Are. Laugh Hysterically After They Answer.

11. Specify That Your Drive-through Order Is "To Go."

12. Sing Along At The Opera.

13. Go To A Poetry Recital And Ask Why The Poems Don't Rhyme.

14. Put Mosquito Netting Around Your Work Area And Play Tropical Sounds All Day.

15. Five Days In Advance, Tell Your Friends You Can't Attend Their Party Because You're Not In The Mood.

16. Have Your Co-workers Address You By Your Wrestling Name, Rock Hard.

17. When The Money Comes Out The ATM, Scream "I Won!, I Won!"

18. When Leaving The Zoo, Start Running Towards The Parking Lot, Yelling "Run For Your Lives, They're Loose!!"

19. Tell Your Children Over Dinner. "Due To The Economy, We Are Going To have To Let One Of You Go."

And The Final Way To Keep A Healthy Level Of Insanity.......

20. Share This With Someone To Make Them Smile...Its Called Therapy...


Metal Skool on Wednesday Nights!!!

Last night I went out and saw Metal Skool at Typhoon Saloon down in PB. This was a hell of alot of fun. Metal Skool is a band that covers 80s HairBand songs. In addition to providing their unique flair of stage antics ranging from wild to wranchy.

They do have a dress code that says you need to wear atleast pants. No shorts, and if you dress up with a wig and be 80'z out, you are allowed in for free... saving $7.00

Official Site -

Fan Site -

Typhoon Saloon -

1165 Garnet Avenue
(Pacific Beach)
San Diego, CA 92109
Phone (858) 373-3444
Fax (858) 274-0849

Wednesday 9:00 pm - 2:00 am

Show really starts at 10/10:30pm.


Large Groups in LDAP and C# .NET

Well, found another issue with migrating mailing lists into Active Directory. The .Net / C# libraries i'm using have a couple issues. First being, most servers are only configured to return 1000 or 1500 values for a specific property, for example "member". So when I'm trying to compare membership, its always missing some. Yet its not really missing them from the GUI tools. To solve this, you need to query this property value with the range= option. There is a real good piece of sample code for C# that you can use to get this done.

Also, there is an article about the truncating membership issue with dot net runtime v1.1 that is resolved with a patch. At the time of this writing it looks that the SP1 for v1.1 of the runtime fixes this issue.

Truncating Membership Issue

This was a good thing to find. Within 20 minutes I had the new code inserted and debugged.