I have a Windows Service running under the NETWORK SERVICE account and have a need to query Active Directory for extended information about users.
It looks like in this situation there are access restrictions that prevent the service from accessing Active Directory. And the service has to be run as NETWORK SERVICE, not domain user.
So far I'm passing credentials (login and password) of a domain user to DirectorySearcher. Credentials are retrieved from config file, which is, of course, not good.
Is there another more elegant way to query Active Directory from service running under the NETWORK SERVICE?