Working on a project, where all users are created in active directory under a domain.
What I want is get all users that are in the domain, is this possible?
I am new to active directory, using .net core2.0.
Any suggestions and guidance is appreciated.
There is an implementation of System.DirectoryServices.AccountManagement
for .NET Core 2, published by the .Net Foundation. See the nuget reference here
This will allow you to make calls like this:
using (var ctx = new PrincipalContext(ContextType.Domain, "MyDomain")){
var myDomainUsers = new List<string>();
var userPrinciple = new UserPrincipal(ctx);
using (var search = new PrincipalSearcher(userPrinciple)){
foreach (var domainUser in search.FindAll()){
if (domainUser.DisplayName != null){
myDomainUsers.Add(domainUser.DisplayName);
}
}
}
}
Exact what i was looking for...
You can use the Microsoft Graph API to interact with the data users in the Microsoft cloud(Including AAD).
Link here
Documentation