简体   繁体   中英

DirectoryEntry() not authenticated

I am trying to use DirectoryEntry to gain access to AD. We have an "OU=Company Users" and then and "OU=Applications". My personal user account is in the Company Users OU and when trying return new DirectoryEntry(Path,UserName,Password,Secure) it works when I use my personal credentials. I would accept that and go on with life but I am not willing to place my credentials in a config file and keep it up to date for the life of the project.

So we created a new account located in the Applications OU. I am not sure how to get authenticated with those credentials and still create the DirectoryEntry with the root path to the other OU.

The OU the account is in has no relation to whether or not you can authenticate to AD with it really. You can just plug the username and password in same as before. Ideally the IIS App Pool would run as this user and you wouldn't even need to store creds or specify them to the directory entry.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM