Exemple #1
0
        public static void RefreshUser(CustomUser UserForChange)
        {
            using (DirectorySearcher dsSearcher = new DirectorySearcher())
            {
                dsSearcher.Filter = InputLDAP.SearchFilter(UserForChange.SAMAccountName);
                SearchResult   result = dsSearcher.FindOne();
                DirectoryEntry de     = result.GetDirectoryEntry();

                HasUserInfo ifUser = new DeUser(de);

                CustomUser NewUser = new CustomUser(ifUser);

                UserForChange.Copy(NewUser);
            }
        }