Skip to content

Commit

Permalink
Finished 0.1.0.0. Testing will begin.
Browse files Browse the repository at this point in the history
  • Loading branch information
krisdb2009 committed Sep 3, 2019
1 parent b25f5d3 commit cc655e9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions SuperADD/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -744,11 +744,13 @@ private void OUList_SelectedIndexChanged(object sender, EventArgs e)
showMsg("OrganizationalUnits element is missing from SuperADD.xml", warnImg);
return;
}
XElement SecurityGroupsDNs = null;
foreach (XElement elm in OUs.Elements("OrganizationalUnit"))
{
XElement Name = elm.Element("Name");
if (Name != null && Name.Value == (string)lv.SelectedItem )
{
SecurityGroupsDNs = elm.Element("SecurityGroupsDNs");
XElement DN = elm.Element("DistinguishedName");
if (DN == null) continue;
currentlySelectedOU = DN.Value;
Expand All @@ -767,6 +769,27 @@ private void OUList_SelectedIndexChanged(object sender, EventArgs e)
if((lv == OUList && tabControl.SelectedTab == compNameTab) && !suppressFindNextName)
{
findNextComputerName();
autoSelectSecurityGroups(SecurityGroupsDNs);
}
}
private void autoSelectSecurityGroups(XElement SecurityGroupsDNs)
{
SGList.ClearSelected();
if (SecurityGroupsDNs == null) return;
foreach(XElement SGDNs in SecurityGroupsDNs.Elements("SecurityGroupDN"))
{
XElement SGs = Config.Current.Element("SecurityGroups");
if (SGs == null) continue;
foreach(XElement SG in SGs.Elements("SecurityGroup"))
{
XElement Name = SG.Element("Name");
XElement DN = SG.Element("DistinguishedName");
if (Name == null || DN == null) continue;
if (DN.Value == SGDNs.Value)
{
SGList.SelectedItems.Add(Name.Value);
}
}
}
}
private void saveNextBtn_Click(object sender, EventArgs e)
Expand Down

0 comments on commit cc655e9

Please sign in to comment.