Example #1
0
        public static string adGetUserPropertyListHtml(string sUserId)
        {
            System.DirectoryServices.AccountManagement.UserPrincipal ctx = adGetUserPrincipalBySAMAccountName(sUserId);
            if (ctx == null)
            {
                return("");
            }
            string sR = "Locked = ";

            if (ctx.IsAccountLockedOut())
            {
                sR += "<font color=red>****YES***</font><br>";
            }
            else
            {
                sR += "Locked = NO<br>";
            }
            foreach (var prop in ctx.GetType().GetProperties())
            {
                sR += prop.Name + " = " + prop.GetValue(ctx, null) + "<br>";
            }
            return(sR);
        }