public void AsyncFill(PanelItemBase parent, ICollection <PanelItemBase> result) { var startPath = LdapUtils.GetDCNameFromPath(LdapUtils.GetUserPath(PluginUsers.ScreenService.UserName), 2); var workspace = parent as WorkspacePanelItem; if (workspace != null) { FillUsersWithSameGroup(ref parent, ref result, startPath, workspace.AdsPath); } else { FillUsers(ref parent, ref result, startPath); } }
public void AsyncFill(PanelItemBase parent, ICollection <PanelItemBase> result) { string startPath; if (parent is UserPanelItem) { startPath = (parent as UserPanelItem).AdsPath; } else { startPath = LdapUtils.GetUserPath(PluginUsers.ScreenService.UserName); } using (var searcher = new DirectorySearcher()) { // execute filter query to Active Directory searcher.SearchRoot = new DirectoryEntry(startPath); searcher.PageSize = Int32.MaxValue; searcher.Filter = "(objectCategory=person)"; // lockoutTime searcher.PropertiesToLoad.Add(Constants.MEMBER_OF); try { var row = searcher.FindOne(); var list = row.Properties[Constants.MEMBER_OF]; foreach (var value in list) { var valueStr = (string)value; var workspace = new WorkspacePanelItem(parent, LdapUtils.GetLdapValue(valueStr)); workspace.AdsPath = valueStr; result.Add(workspace); } } catch (Exception ex) { Debug.Print(ex.Message); } } }
public UserRoot() { m_StartPath = LdapUtils.GetUserPath(PluginUsers.ScreenService.UserName); m_StartPath = LdapUtils.GetDCNameFromPath(m_StartPath, 2); }