473,406 Members | 2,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Windows Service & DirectoryServices & IIS

Hi

I'm writing windows service which is suppose to acces IIS metabase using DirectoryServices. I'm accesing IIS using the code below:

Expand|Select|Wrap|Line Numbers
  1. DirectoryEntry iisEntry = new DirectoryEntry(@"IIS://" + _iis + @"/W3SVC", userName + "@" + domain, password, AuthenticationTypes.Secure);
  2.  
  3. foreach (DirectoryEntry webServerEntry in iisEntry.Children)
  4. {
  5.         //some code here
  6. }
  7.  
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 SecurityImpersonation and SecurityDelegation) without effect. If someone can help me I would be really greatful.

Greetings,
Tomek
Feb 25 '08 #1
0 781

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: cyshao | last post by:
How to debug a service ? Hi, friends: I created a new C# service project and wrote some log in OnStart() function. But when I type F5 to debug it, system prompt me "Can't debug a service...
1
by: Günther Rühmann | last post by:
Hi, I´m not sure if i´m right int this group... My problem: I made a vb .net application that reads from AD via System.Directoryservices.Directoryentry. The appliocation enumerates group...
9
by: Günther Rühmann | last post by:
Hi, I´m not sure if i´m right int this group... My problem: I made a vb .net application that reads from AD via System.Directoryservices.Directoryentry. The appliocation enumerates group...
2
by: Budhi Saputra Prasetya | last post by:
Hi, I managed to create a Windows Form Control and put it on my ASP .NET page. I have done the suggestion that is provided by modifying the security settings. From the stack trace, I would...
0
by: Budhi Saputra Prasetya | last post by:
Hi, I still have the same problem with embedding Windows Control. I'll just requote what I posted last time: I managed to create a Windows Form Control and put it on my ASP .NET page. I...
5
by: Elmo Watson | last post by:
I have a new application I need to do here at work - - however, they want several things I don't know about and I would like pointers toward the right direction for learning. Built on Windows...
1
by: mdhaman | last post by:
hi, I have a windows service written in VB.Net and framework 2.0. It is a multithread service and it is using threadpool to manage threads. Recently I have started getting...
1
by: greenzrx | last post by:
I have the following snippet of code which works both as a standalone application and as when incorporated to a windows service. There seems to be a slight difference between the service and the...
0
by: John Wright | last post by:
I have created a web service that will validate a username/password combination against LDAP. I encrypt the username/password, send it to my web service which decrypts the username/password,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.