Wednesday, July 16, 2014

check valid user - checking directly with AD


private static bool checkvaliduser(string strADLoginName)
{
bool userExists = false;
using (PrincipalContext context = new PrincipalContext(ContextType.Domain, "hgrp", "DC=hgrp,DC=com,DC=sg"))
{
using (UserPrincipal user = UserPrincipal.FindByIdentity(context, strADLoginName))
{
userExists = (user != null);
}
}
return userExists;
}

No comments:

Post a Comment

Image noise comparison methods

 1. using reference image technique     - peak_signal_noise_ratio (PSNR)     - SSI 2. non-reference image technique     - BRISQUE python pac...