Trying to invoke the GetDomains() method fails (Object reference not set to an instance of an object)

Dec 27, 2012 at 4:55 PM
Edited Dec 27, 2012 at 4:57 PM

I have the web service up and running on my IIS server, and I can browse to the ad.asmx file.  Other functions, such as GetForest() or GetOUS() work as expected, but when I try to invoke the GetDomains() method, either through a web browser or via code, it fails.  It finds the root domain (we have a root domain with 5 sub domains), and then also the first sub domain, but then fails with an exception.

The logs show (sensitive domain names removed):

2012-12-26 18:25:42.2523|INFO|MaikKoster.Deployment.WebService.AD|Requested list of all Active Directory Domains in the current Forest

2012-12-26 18:25:42.2523|TRACE|MaikKoster.Deployment.AD.Controller|entering method

2012-12-26 18:25:42.2523|DEBUG|MaikKoster.Deployment.AD.Controller|Get list of domains in the current forest.

2012-12-26 18:25:42.2523|DEBUG|MaikKoster.Deployment.AD.Controller|Getting all domains from current forest.

2012-12-26 18:25:42.2523|TRACE|MaikKoster.Deployment.AD.Controller|entering method

2012-12-26 18:25:42.2523|DEBUG|MaikKoster.Deployment.AD.Controller|Get current Forest

2012-12-26 18:25:42.2523|TRACE|MaikKoster.Deployment.AD.Controller|entering method

2012-12-26 18:25:42.2523|TRACE|MaikKoster.Deployment.AD.Controller|leaving method

2012-12-26 18:25:42.2523|DEBUG|MaikKoster.Deployment.AD.Controller|Found Forest <root domain> for Domain <domain>2012-12-26 18:25:42.2523|TRACE|MaikKoster.Deployment.AD.Controller|leaving method

2012-12-26 18:25:42.2703|DEBUG|MaikKoster.Deployment.AD.Controller|Found Domain <domain2>.

2012-12-26 18:25:42.2703|DEBUG|MaikKoster.Deployment.AD.Controller|Retrieving additional information.

2012-12-26 18:25:42.2703|DEBUG|MaikKoster.Deployment.AD.Controller|Exception: Object reference not set to an instance of an object..