Retrieve users and groups from Active Directory (AD)

Below code describes how to get all users and all groups from active directory (AD Server) Using System.DirectoryServices Steps:- Add System.Directoryservices.dll and System.Directoryservices.AccountManagement.dll which provides access to active directory. Using System.DirectoryServices.AccountManagement I have used a generic list (collection of string) to store account name of user and group.   class Program { static void Main(string[] args) { ┬áList<string> _userOrGroupColl = […]