diff --git a/SuperADD/Main.cs b/SuperADD/Main.cs index fa80ebb..ea5caac 100644 --- a/SuperADD/Main.cs +++ b/SuperADD/Main.cs @@ -35,6 +35,7 @@ public partial class Main : Form private int spookyCount = 5; private int autoRunIndex = -1; private bool autoRunContinue = false; + private string currentCreateSelectedOU = ""; List invalidNameCharacters = new List { ' ', '{', '|', '}', '~', '[', '\\', ']', '^', '\'', ':', ';', '<', '=', '>', @@ -107,7 +108,7 @@ public Main(int autoIndex = -1, bool autoContinue = false) foreach (XElement ou in Config.Current.Element("OrganizationalUnits").Elements("OrganizationalUnit")) { OUList.Items.Add(ou.Element("Name").Value); - dirlookOUList.Items.Add(ou.Element("Name").Value); + dirLookOUList.Items.Add(ou.Element("Name").Value); } foreach (XElement descItem in Config.Current.Element("DescriptionItems").Elements("DescriptionItem")) @@ -196,7 +197,7 @@ private async void retrieveCurrentlySelectedOUList() private void currentlySelectedOUListUpdated() { - if (tabControl.SelectedTab == compSearchPage) + if (tabControl.SelectedTab == dirLookTab) { string filter = directorySearchTb.Text; computerLookList.BeginUpdate(); @@ -210,7 +211,7 @@ private void currentlySelectedOUListUpdated() } computerLookList.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); computerLookList.EndUpdate(); - dirlookOUList.Enabled = true; + dirLookOUList.Enabled = true; } else if (tabControl.SelectedTab == compNameTab) { @@ -322,7 +323,7 @@ private async void createComputer() showMsg("Adding computer to Active Directory...", loadImg, dismissable: false); Dictionary postData = new Dictionary(); postData.Add("domain", adDomainName); - postData.Add("basedn", currentlySelectedOU); + postData.Add("basedn", currentCreateSelectedOU); postData.Add("username", adUserName); postData.Add("password", adPassword); postData.Add("function", "update"); @@ -381,7 +382,7 @@ private void setTSVariables(bool joinDomain = true, bool exitSuperADD = true) tsEnv["DOMAINADMIN"] = tsEnv["USERID"]; tsEnv["DOMAINADMINDOMAIN"] = tsEnv["USERDOMAIN"]; tsEnv["DOMAINADMINPASSWORD"] = tsEnv["USERPASSWORD"]; - tsEnv["MACHINEOBJECTOU"] = currentlySelectedOU; + tsEnv["MACHINEOBJECTOU"] = currentCreateSelectedOU; tsEnv["JOINWORKGROUP"] = ""; } else @@ -409,7 +410,7 @@ private void directorySearchTb_TextChanged(object sender, EventArgs e) private void computerLookList_DoubleClick(object sender, EventArgs e) { - OUList.SelectedIndex = dirlookOUList.SelectedIndex; + OUList.SelectedIndex = dirLookOUList.SelectedIndex; nameTextBox.Text = computerLookList.SelectedItems[0].Text; descTextBox.Text = computerLookList.SelectedItems[0].SubItems[1].Text; computerOverwriteConfirmed = true; @@ -441,10 +442,14 @@ private void OUList_SelectedIndexChanged(object sender, EventArgs e) if (elm.Element("Name").Value == (string)lv.SelectedItem) { currentlySelectedOU = elm.Element("DistinguishedName").Value; + if(lv == OUList) + { + currentCreateSelectedOU = elm.Element("DistinguishedName").Value; + } break; } } - if ((lv == OUList && tabControl.SelectedTab == compNameTab) || lv == dirlookOUList) + if ((lv == OUList && tabControl.SelectedTab == compNameTab) || lv == dirLookOUList) { lv.Enabled = false; retrieveCurrentlySelectedOUList(); diff --git a/SuperADD/MainForm.Designer.cs b/SuperADD/MainForm.Designer.cs index eb705d3..a8686ce 100644 --- a/SuperADD/MainForm.Designer.cs +++ b/SuperADD/MainForm.Designer.cs @@ -43,9 +43,9 @@ private void InitializeComponent() this.compNameTab = new System.Windows.Forms.TabPage(); this.skipJoinBtn = new System.Windows.Forms.Button(); this.spookyBoi = new System.Windows.Forms.PictureBox(); - this.compSearchPage = new System.Windows.Forms.TabPage(); + this.dirLookTab = new System.Windows.Forms.TabPage(); this.directorySearchTb = new System.Windows.Forms.TextBox(); - this.dirlookOUList = new System.Windows.Forms.ListBox(); + this.dirLookOUList = new System.Windows.Forms.ListBox(); this.computerLookList = new System.Windows.Forms.ListView(); this.compColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.descColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -69,7 +69,7 @@ private void InitializeComponent() this.tabControl.SuspendLayout(); this.compNameTab.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.spookyBoi)).BeginInit(); - this.compSearchPage.SuspendLayout(); + this.dirLookTab.SuspendLayout(); this.msgPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.msgPic)).BeginInit(); this.promptPanel.SuspendLayout(); @@ -210,7 +210,7 @@ private void InitializeComponent() // tabControl // this.tabControl.Controls.Add(this.compNameTab); - this.tabControl.Controls.Add(this.compSearchPage); + this.tabControl.Controls.Add(this.dirLookTab); this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl.Location = new System.Drawing.Point(10, 10); this.tabControl.Name = "tabControl"; @@ -258,16 +258,16 @@ private void InitializeComponent() // // compSearchPage // - this.compSearchPage.Controls.Add(this.directorySearchTb); - this.compSearchPage.Controls.Add(this.dirlookOUList); - this.compSearchPage.Controls.Add(this.computerLookList); - this.compSearchPage.Location = new System.Drawing.Point(4, 25); - this.compSearchPage.Name = "compSearchPage"; - this.compSearchPage.Padding = new System.Windows.Forms.Padding(3); - this.compSearchPage.Size = new System.Drawing.Size(667, 428); - this.compSearchPage.TabIndex = 1; - this.compSearchPage.Text = "Directory Lookup"; - this.compSearchPage.UseVisualStyleBackColor = true; + this.dirLookTab.Controls.Add(this.directorySearchTb); + this.dirLookTab.Controls.Add(this.dirLookOUList); + this.dirLookTab.Controls.Add(this.computerLookList); + this.dirLookTab.Location = new System.Drawing.Point(4, 25); + this.dirLookTab.Name = "compSearchPage"; + this.dirLookTab.Padding = new System.Windows.Forms.Padding(3); + this.dirLookTab.Size = new System.Drawing.Size(667, 428); + this.dirLookTab.TabIndex = 1; + this.dirLookTab.Text = "Directory Lookup"; + this.dirLookTab.UseVisualStyleBackColor = true; // // directorySearchTb // @@ -282,16 +282,16 @@ private void InitializeComponent() // // dirlookOUList // - this.dirlookOUList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.dirLookOUList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); - this.dirlookOUList.FormattingEnabled = true; - this.dirlookOUList.IntegralHeight = false; - this.dirlookOUList.ItemHeight = 16; - this.dirlookOUList.Location = new System.Drawing.Point(2, 4); - this.dirlookOUList.Name = "dirlookOUList"; - this.dirlookOUList.Size = new System.Drawing.Size(195, 422); - this.dirlookOUList.TabIndex = 2; - this.dirlookOUList.SelectedIndexChanged += new System.EventHandler(this.OUList_SelectedIndexChanged); + this.dirLookOUList.FormattingEnabled = true; + this.dirLookOUList.IntegralHeight = false; + this.dirLookOUList.ItemHeight = 16; + this.dirLookOUList.Location = new System.Drawing.Point(2, 4); + this.dirLookOUList.Name = "dirlookOUList"; + this.dirLookOUList.Size = new System.Drawing.Size(195, 422); + this.dirLookOUList.TabIndex = 2; + this.dirLookOUList.SelectedIndexChanged += new System.EventHandler(this.OUList_SelectedIndexChanged); // // computerLookList // @@ -491,8 +491,8 @@ private void InitializeComponent() this.tabControl.ResumeLayout(false); this.compNameTab.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.spookyBoi)).EndInit(); - this.compSearchPage.ResumeLayout(false); - this.compSearchPage.PerformLayout(); + this.dirLookTab.ResumeLayout(false); + this.dirLookTab.PerformLayout(); this.msgPanel.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.msgPic)).EndInit(); this.promptPanel.ResumeLayout(false); @@ -517,11 +517,11 @@ private void InitializeComponent() private System.Windows.Forms.Label descLbl; private System.Windows.Forms.TabControl tabControl; private System.Windows.Forms.TabPage compNameTab; - private System.Windows.Forms.TabPage compSearchPage; + private System.Windows.Forms.TabPage dirLookTab; private System.Windows.Forms.ListView computerLookList; private System.Windows.Forms.ColumnHeader compColumn; private System.Windows.Forms.ColumnHeader descColumn; - private System.Windows.Forms.ListBox dirlookOUList; + private System.Windows.Forms.ListBox dirLookOUList; private System.Windows.Forms.TextBox directorySearchTb; private System.Windows.Forms.Panel msgPanel; private System.Windows.Forms.PictureBox msgPic; diff --git a/SuperADD/Properties/AssemblyInfo.cs b/SuperADD/Properties/AssemblyInfo.cs index 4e5b44e..8dbe00b 100644 --- a/SuperADD/Properties/AssemblyInfo.cs +++ b/SuperADD/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("SuperADD")] +[assembly: AssemblyTitle("Super MDT Active Directory Deploy")] [assembly: AssemblyDescription("Super MDT Active Directory Deploy")] [assembly: AssemblyConfiguration("Dylan Bickerstaff")] [assembly: AssemblyCompany("Dylan Bickerstaff")] @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.0.4")] -[assembly: AssemblyFileVersion("0.0.0.4")] +[assembly: AssemblyVersion("0.0.0.5")] +[assembly: AssemblyFileVersion("0.0.0.5")]