public ADUser(string userId, DirectoryEntry searchRoot) { this.userId = userId; ADUtil ad = new ADUtil(); this.userEntry = ad.GetUserDirectoryEntry(userId, new string[] { "givenName", "sn", "maxPwdAge", "pwdLastSet" }, searchRoot); this.firstName = EntryUtil.GetProperty(userEntry, "givenName"); this.lastName = EntryUtil.GetProperty(userEntry, "sn"); this.mailBoxLocation = EntryUtil.GetProperty(userEntry, "HomeMDB"); this.hasExchangeMailBox = !string.IsNullOrEmpty(this.mailBoxLocation); this.emailAddress = EntryUtil.GetProperty(userEntry, "mail"); }