Request Active Directory in NT / NETWORK Authorization Service

I have a Windows service running under the NETWORK SERVICE account and you need to query Active Directory to get advanced user information.

It seems that in this situation, there are access restrictions that prevent the service from accessing Active Directory. And the service should run as a NETWORK SERVICE service, not a domain user.

So far, I am transferring the credentials (username and password) of a domain user to DirectorySearcher. Credentials are extracted from the configuration file, which, of course, is not very good.

Is there an even more elegant way to query Active Directory from a service running on NETWORK SERVICE?

+3
source share
2 answers

, Active Directory LDAP.

, , NT AUTHORITY\Network Service .

. DirectorySearcher

+5

(COMPUTERNAME $) Active Directory, @Harvery Kwok , ( ).

+1

All Articles