![]() |
| system.directoryServices |
|
byron
Forum Admin
|
Trying to enumerate some web site setting via a web service on my local machine.
Here's the code: [WebMethod] public string getServiceNumber (string comment) { string rtn = ""; DirectoryEntry w3svc = new DirectoryEntry ("IIS://127.0.0.1/w3svc"); rtn = ""; try { foreach (string propName in w3svc.Properties.PropertyNames) { rtn = rtn + propName + " "; } } catch (System.Exception e) { rtn = e.Message; } return rtn; } The errror I'm recieving is when propertyNames is accessed. {"The directory cannot report the number of properties." } Any help would be appreciated. Does this have something to do with my local machine Win Pro 2000, not having AD on it? |
||||||||||||
|
|
|||||||||||||
|
Josh
Forum Regular
|
You need to use the DirectorySearcher class to do what you're trying to do if I'm not mistaken. This is off the top of my head, but try this.
|
||||||||||||||
|
|
|||||||||||||||
|
byron
Forum Admin
|
It did wind up being a syntax problem and the way I was accessing the objects. I'm still a little hazy on the permissions issues and what account the web services really run under.
|
||||||||||||
|
|
|||||||||||||
| system.directoryServices |
|
||
|


