This is a simple wrapper around Microsoft's directory services assembly.
🚧 Warning: the packages are not available yet on NuGet.
Use the package manager NuGet to install this library:
dotnet add package Dime.DirectoryServices
public async Task<boolean> Exists(string userName)
{
WindowsUserStore store = new WindowsUserStore("Admin", "Admin123");
string sid = await store.GetSidByLoginName(userName);
return !string.IsNullOrEmpty(sid);
}
Pull requests are welcome. Please check out the contribution and code of conduct guidelines.