Hi @john john ,
The specific usage of DirectoryEntry and PrincipalContext can be found in the official documentation:
PrincipalContext:
public PrincipalContext (System.DirectoryServices.AccountManagement.ContextType contextType, string name, string container, string userName, string password);
string name:the domain name (e.g. "YOURDOMAIN" - or leave NULL for "default" domain)
string container:optionally a container (as an LDAP path - a "distinguished" name, full path but without any LDAP:// prefix)
DirectoryEntry
public DirectoryEntry (string? path, string? username, string? password);
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.