Hello there,
There are two approaches to validate user credentials in Active Directory using C#
-System.DirectoryServices.AccountManagement
-System.DirectoryServices
This article describes how to use the DirectoryServices namespace to add a user to the local system and a group in Visual C#. Add a user to the local system by using directory services and Visual C sharp https://learn.microsoft.com/en-us/troubleshoot/developer/visualstudio/csharp/language-compilers/add-user-local-system
I hope this information helps. If you have any questions please let me know and I will be glad to help you out.
--------------------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer--