private void SetWorkstationOUs() { if (string.IsNullOrEmpty(WorkstationGroupSelected)) { return; } else { workstationOUComboBox.DataSource = null; _workstationOUs = ADContext.GetWorkstationGroupOUs(WorkstationGroupSelected); workstationOUComboBox.DataSource = _workstationOUs; workstationOUComboBox.Refresh(); } }
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(); }