У меня вот так работает. Только ссылку на System.DirectoryServices.AccountManagement вручную в AOT\References пришлось добавить.
X++:
static void JobCheckUserPassword(Args _args)
{
System.DirectoryServices.AccountManagement.PrincipalContext
pc = new System.DirectoryServices.AccountManagement.PrincipalContext(
System.DirectoryServices.AccountManagement.ContextType::Domain);
boolean bt = false;
;
try
{
bt = pc.ValidateCredentials(
"user_name",
"password",
System.DirectoryServices.AccountManagement.ContextOptions::Negotiate);
}
catch
{
error("error");
}
pc.Dispose();
info(strfmt("%1", bt));
}