private void SetWorkstationData()
 {
     _workstationGroups = ADContext.GetWorkstationGroups();
     workstationGroupsComboBox.DataSource = _workstationGroups;
     if (_workstationGroups.Count > 0)
     {
         SetWorkstationOUs();
     }
 }
        private void SetWorkstationGroups()
        {
            List <string> groups = ADContext.GetWorkstationGroups();

            if (groups != null)
            {
                for (int i = 0; i < groups.Count; i++)
                {
                    _groupCheckBoxes[i].Text = groups[i];
                    _groupCheckBoxes[i].Show();
                }
            }
        }
Example #3
0
        private static void WriteWorkstationPrefs(XmlWriter writer)
        {
            writer.WriteStartElement("WorkstationGroups");
            var groups = ADContext.GetWorkstationGroups();

            for (int i = 0; i < groups.Count; i++)
            {
                writer.WriteStartElement(groups[i]);
                var groupOUs = ADContext.GetWorkstationGroupOUs(groups[i]);
                if (groupOUs != null)
                {
                    for (int j = 0; j < groupOUs.Count; j++)
                    {
                        writer.WriteStartElement("OU" + (j + 1));
                        writer.WriteString(groupOUs[j]);
                        writer.WriteEndElement();
                    }
                }
                writer.WriteEndElement();
            }
            writer.WriteEndElement();
        }