Hi
I'm writing windows service which is suppose to acces IIS metabase using DirectoryServic es. I'm accesing IIS using the code below:
At begining of foreach statement I'm getting "Acces denied" exception. The same piece of code running from Visual Studio works fine. I was also trying impersation (with levels SecurityImperso nation and SecurityDelegat ion) without effect. If someone can help me I would be really greatful.
Greetings,
Tomek
I'm writing windows service which is suppose to acces IIS metabase using DirectoryServic es. I'm accesing IIS using the code below:
Code:
DirectoryEntry iisEntry = new DirectoryEntry(@"IIS://" + _iis + @"/W3SVC", userName + "@" + domain, password, AuthenticationTypes.Secure);
foreach (DirectoryEntry webServerEntry in iisEntry.Children)
{
//some code here
}
Greetings,
Tomek