From 3f8d3fe2f268d9c7fc90b73d8ea88a336ea9e3f6 Mon Sep 17 00:00:00 2001 From: Jonathan Perry Date: Fri, 18 Jan 2019 08:38:28 -0500 Subject: [PATCH] Added ability to create a New GPO. It will then import settings from a Sample GPO to create the reference to the proper XML files. --- .../DialogAddOption.Designer.vb | 4 +- .../DialogNewPolicy.Designer.vb | 110 ++++++++++++++++ .../DialogNewPolicy.resx | 120 ++++++++++++++++++ .../DialogNewPolicy.vb | 15 +++ .../DialogSettings.Designer.vb | 54 +++++--- GroupPolicyNetworkLocations/DialogSettings.vb | 59 +++++++-- .../GroupPolicyNetworkLocations.vb | 11 +- .../GroupPolicyNetworkLocations.vbproj | 25 +++- .../My Project/AssemblyInfo.vb | 4 +- .../My Project/Resources.Designer.vb | 12 +- .../My Project/Resources.resx | 3 + .../Resources/SampleGPO.zip | Bin 0 -> 9964 bytes 12 files changed, 378 insertions(+), 39 deletions(-) create mode 100644 GroupPolicyNetworkLocations/DialogNewPolicy.Designer.vb create mode 100644 GroupPolicyNetworkLocations/DialogNewPolicy.resx create mode 100644 GroupPolicyNetworkLocations/DialogNewPolicy.vb create mode 100644 GroupPolicyNetworkLocations/Resources/SampleGPO.zip diff --git a/GroupPolicyNetworkLocations/DialogAddOption.Designer.vb b/GroupPolicyNetworkLocations/DialogAddOption.Designer.vb index 3719f6c..581e53d 100644 --- a/GroupPolicyNetworkLocations/DialogAddOption.Designer.vb +++ b/GroupPolicyNetworkLocations/DialogAddOption.Designer.vb @@ -39,7 +39,7 @@ Partial Class DialogAddOption Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0) Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0) - Me.TableLayoutPanel1.Location = New System.Drawing.Point(104, 113) + Me.TableLayoutPanel1.Location = New System.Drawing.Point(111, 113) Me.TableLayoutPanel1.Name = "TableLayoutPanel1" Me.TableLayoutPanel1.RowCount = 1 Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) @@ -97,7 +97,7 @@ Partial Class DialogAddOption Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.Cancel_Button - Me.ClientSize = New System.Drawing.Size(262, 154) + Me.ClientSize = New System.Drawing.Size(269, 154) Me.Controls.Add(Me.LabelPrompt) Me.Controls.Add(Me.LabelDescription) Me.Controls.Add(Me.ComboBoxOptionList) diff --git a/GroupPolicyNetworkLocations/DialogNewPolicy.Designer.vb b/GroupPolicyNetworkLocations/DialogNewPolicy.Designer.vb new file mode 100644 index 0000000..79ab885 --- /dev/null +++ b/GroupPolicyNetworkLocations/DialogNewPolicy.Designer.vb @@ -0,0 +1,110 @@ + _ +Partial Class DialogNewPolicy + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() + Me.OK_Button = New System.Windows.Forms.Button() + Me.Cancel_Button = New System.Windows.Forms.Button() + Me.Label1 = New System.Windows.Forms.Label() + Me.TextBoxPolicyName = New System.Windows.Forms.TextBox() + Me.TableLayoutPanel1.SuspendLayout() + Me.SuspendLayout() + ' + 'TableLayoutPanel1 + ' + Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.TableLayoutPanel1.ColumnCount = 2 + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) + Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0) + Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0) + Me.TableLayoutPanel1.Location = New System.Drawing.Point(111, 113) + Me.TableLayoutPanel1.Name = "TableLayoutPanel1" + Me.TableLayoutPanel1.RowCount = 1 + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) + Me.TableLayoutPanel1.Size = New System.Drawing.Size(146, 29) + Me.TableLayoutPanel1.TabIndex = 0 + ' + 'OK_Button + ' + Me.OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None + Me.OK_Button.Location = New System.Drawing.Point(3, 3) + Me.OK_Button.Name = "OK_Button" + Me.OK_Button.Size = New System.Drawing.Size(67, 23) + Me.OK_Button.TabIndex = 0 + Me.OK_Button.Text = "OK" + ' + 'Cancel_Button + ' + Me.Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None + Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.Cancel_Button.Location = New System.Drawing.Point(76, 3) + Me.Cancel_Button.Name = "Cancel_Button" + Me.Cancel_Button.Size = New System.Drawing.Size(67, 23) + Me.Cancel_Button.TabIndex = 1 + Me.Cancel_Button.Text = "Cancel" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 9) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(66, 13) + Me.Label1.TabIndex = 1 + Me.Label1.Text = "Policy Name" + ' + 'TextBoxPolicyName + ' + Me.TextBoxPolicyName.Location = New System.Drawing.Point(12, 29) + Me.TextBoxPolicyName.Name = "TextBoxPolicyName" + Me.TextBoxPolicyName.Size = New System.Drawing.Size(242, 20) + Me.TextBoxPolicyName.TabIndex = 2 + ' + 'DialogNewPolicy + ' + Me.AcceptButton = Me.OK_Button + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.Cancel_Button + Me.ClientSize = New System.Drawing.Size(269, 154) + Me.Controls.Add(Me.TextBoxPolicyName) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.TableLayoutPanel1) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "DialogNewPolicy" + Me.ShowInTaskbar = False + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "New Policy" + Me.TableLayoutPanel1.ResumeLayout(False) + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel + Friend WithEvents OK_Button As System.Windows.Forms.Button + Friend WithEvents Cancel_Button As System.Windows.Forms.Button + Friend WithEvents Label1 As Label + Friend WithEvents TextBoxPolicyName As TextBox +End Class diff --git a/GroupPolicyNetworkLocations/DialogNewPolicy.resx b/GroupPolicyNetworkLocations/DialogNewPolicy.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/GroupPolicyNetworkLocations/DialogNewPolicy.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GroupPolicyNetworkLocations/DialogNewPolicy.vb b/GroupPolicyNetworkLocations/DialogNewPolicy.vb new file mode 100644 index 0000000..8e68bed --- /dev/null +++ b/GroupPolicyNetworkLocations/DialogNewPolicy.vb @@ -0,0 +1,15 @@ +Imports System.Windows.Forms + +Public Class DialogNewPolicy + + Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click + Me.DialogResult = System.Windows.Forms.DialogResult.OK + Me.Close() + End Sub + + Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click + Me.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.Close() + End Sub + +End Class diff --git a/GroupPolicyNetworkLocations/DialogSettings.Designer.vb b/GroupPolicyNetworkLocations/DialogSettings.Designer.vb index 325bf7d..07c6f27 100644 --- a/GroupPolicyNetworkLocations/DialogSettings.Designer.vb +++ b/GroupPolicyNetworkLocations/DialogSettings.Designer.vb @@ -37,18 +37,19 @@ Partial Class DialogSettings Me.ButtonNoMADHomeSharesDeleteOption = New System.Windows.Forms.Button() Me.ButtonNoMADHomeSharesAddOption = New System.Windows.Forms.Button() Me.GroupBox1 = New System.Windows.Forms.GroupBox() + Me.CheckBoxAllGroups = New System.Windows.Forms.CheckBox() Me.ButtonNoMADHomeSharesDeleteGroup = New System.Windows.Forms.Button() Me.ButtonNoMADHomeShareAddGroup = New System.Windows.Forms.Button() Me.ListBoxNoMADHomeSharesGroups = New System.Windows.Forms.ListBox() Me.CheckBoxNoMADHomeShareAutoMount = New System.Windows.Forms.CheckBox() Me.TabPage3 = New System.Windows.Forms.TabPage() + Me.CheckBoxNoMADDefaultsConnectedOnly = New System.Windows.Forms.CheckBox() Me.GroupBox3 = New System.Windows.Forms.GroupBox() Me.ListBoxNoMADDefaultsOptions = New System.Windows.Forms.ListBox() Me.ButtonNoMADDefaultsDeleteOption = New System.Windows.Forms.Button() Me.ButtonNoMADDefaultsAddOption = New System.Windows.Forms.Button() Me.CheckBoxNoMADDefaultsAutoMount = New System.Windows.Forms.CheckBox() - Me.CheckBoxNoMADDefaultsConnectedOnly = New System.Windows.Forms.CheckBox() - Me.CheckBoxAllGroups = New System.Windows.Forms.CheckBox() + Me.ButtonCreateNewPolicy = New System.Windows.Forms.Button() Me.TableLayoutPanel1.SuspendLayout() Me.TabControl1.SuspendLayout() Me.TabPage1.SuspendLayout() @@ -141,6 +142,7 @@ Partial Class DialogSettings ' 'TabPage1 ' + Me.TabPage1.Controls.Add(Me.ButtonCreateNewPolicy) Me.TabPage1.Controls.Add(Me.Label2) Me.TabPage1.Controls.Add(Me.Label1) Me.TabPage1.Controls.Add(Me.TextBoxGroupPolicyUID) @@ -217,6 +219,16 @@ Partial Class DialogSettings Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Groups" ' + 'CheckBoxAllGroups + ' + Me.CheckBoxAllGroups.AutoSize = True + Me.CheckBoxAllGroups.Location = New System.Drawing.Point(7, 15) + Me.CheckBoxAllGroups.Name = "CheckBoxAllGroups" + Me.CheckBoxAllGroups.Size = New System.Drawing.Size(74, 17) + Me.CheckBoxAllGroups.TabIndex = 3 + Me.CheckBoxAllGroups.Text = "All Groups" + Me.CheckBoxAllGroups.UseVisualStyleBackColor = True + ' 'ButtonNoMADHomeSharesDeleteGroup ' Me.ButtonNoMADHomeSharesDeleteGroup.Location = New System.Drawing.Point(104, 152) @@ -267,6 +279,17 @@ Partial Class DialogSettings Me.TabPage3.Text = "NoMAD Defaults" Me.TabPage3.UseVisualStyleBackColor = True ' + 'CheckBoxNoMADDefaultsConnectedOnly + ' + Me.CheckBoxNoMADDefaultsConnectedOnly.AutoSize = True + Me.CheckBoxNoMADDefaultsConnectedOnly.Location = New System.Drawing.Point(8, 29) + Me.CheckBoxNoMADDefaultsConnectedOnly.Name = "CheckBoxNoMADDefaultsConnectedOnly" + Me.CheckBoxNoMADDefaultsConnectedOnly.RightToLeft = System.Windows.Forms.RightToLeft.No + Me.CheckBoxNoMADDefaultsConnectedOnly.Size = New System.Drawing.Size(102, 17) + Me.CheckBoxNoMADDefaultsConnectedOnly.TabIndex = 5 + Me.CheckBoxNoMADDefaultsConnectedOnly.Text = "Connected Only" + Me.CheckBoxNoMADDefaultsConnectedOnly.UseVisualStyleBackColor = True + ' 'GroupBox3 ' Me.GroupBox3.Controls.Add(Me.ListBoxNoMADDefaultsOptions) @@ -316,26 +339,14 @@ Partial Class DialogSettings Me.CheckBoxNoMADDefaultsAutoMount.Text = "Auto Mount" Me.CheckBoxNoMADDefaultsAutoMount.UseVisualStyleBackColor = True ' - 'CheckBoxNoMADDefaultsConnectedOnly - ' - Me.CheckBoxNoMADDefaultsConnectedOnly.AutoSize = True - Me.CheckBoxNoMADDefaultsConnectedOnly.Location = New System.Drawing.Point(8, 29) - Me.CheckBoxNoMADDefaultsConnectedOnly.Name = "CheckBoxNoMADDefaultsConnectedOnly" - Me.CheckBoxNoMADDefaultsConnectedOnly.RightToLeft = System.Windows.Forms.RightToLeft.No - Me.CheckBoxNoMADDefaultsConnectedOnly.Size = New System.Drawing.Size(102, 17) - Me.CheckBoxNoMADDefaultsConnectedOnly.TabIndex = 5 - Me.CheckBoxNoMADDefaultsConnectedOnly.Text = "Connected Only" - Me.CheckBoxNoMADDefaultsConnectedOnly.UseVisualStyleBackColor = True - ' - 'CheckBoxAllGroups + 'ButtonCreateNewPolicy ' - Me.CheckBoxAllGroups.AutoSize = True - Me.CheckBoxAllGroups.Location = New System.Drawing.Point(7, 15) - Me.CheckBoxAllGroups.Name = "CheckBoxAllGroups" - Me.CheckBoxAllGroups.Size = New System.Drawing.Size(74, 17) - Me.CheckBoxAllGroups.TabIndex = 3 - Me.CheckBoxAllGroups.Text = "All Groups" - Me.CheckBoxAllGroups.UseVisualStyleBackColor = True + Me.ButtonCreateNewPolicy.Location = New System.Drawing.Point(286, 60) + Me.ButtonCreateNewPolicy.Name = "ButtonCreateNewPolicy" + Me.ButtonCreateNewPolicy.Size = New System.Drawing.Size(113, 23) + Me.ButtonCreateNewPolicy.TabIndex = 5 + Me.ButtonCreateNewPolicy.Text = "Create New Policy" + Me.ButtonCreateNewPolicy.UseVisualStyleBackColor = True ' 'DialogSettings ' @@ -395,4 +406,5 @@ Partial Class DialogSettings Friend WithEvents ButtonNoMADDefaultsAddOption As Button Friend WithEvents CheckBoxNoMADDefaultsAutoMount As CheckBox Friend WithEvents CheckBoxAllGroups As CheckBox + Friend WithEvents ButtonCreateNewPolicy As Button End Class diff --git a/GroupPolicyNetworkLocations/DialogSettings.vb b/GroupPolicyNetworkLocations/DialogSettings.vb index b6f1401..c34ea03 100644 --- a/GroupPolicyNetworkLocations/DialogSettings.vb +++ b/GroupPolicyNetworkLocations/DialogSettings.vb @@ -1,21 +1,24 @@ Imports System.DirectoryServices Imports System.Windows.Forms +Imports GPMGMTLib +Imports System.IO +Imports System.IO.Compression Public Class DialogSettings - Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click - Me.DialogResult = System.Windows.Forms.DialogResult.OK + Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles OK_Button.Click + Me.DialogResult = DialogResult.OK Me.Close() End Sub - Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click - Me.DialogResult = System.Windows.Forms.DialogResult.Cancel + Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles Cancel_Button.Click + Me.DialogResult = DialogResult.Cancel Me.Close() End Sub Private Sub ComboBoxGroupPolicies_SelectedValueChanged(sender As Object, e As EventArgs) Handles ComboBoxGroupPolicies.SelectedValueChanged Try - If ComboBoxGroupPolicies.SelectedValue.GetType = System.Type.GetType("System.String") Then + If ComboBoxGroupPolicies.SelectedValue.GetType = Type.GetType("System.String") Then TextBoxGroupPolicyUID.Text = ComboBoxGroupPolicies.SelectedValue.ToString End If Catch @@ -24,8 +27,7 @@ Public Class DialogSettings End Sub Private Sub ButtonNoMADHomeSharesAddOption_Click(sender As Object, e As EventArgs) Handles ButtonNoMADHomeSharesAddOption.Click - Dim result As DialogResult = DialogAddOption.ShowDialog() - If result = DialogResult.OK Then + If DialogAddOption.ShowDialog() = DialogResult.OK Then Dim NewOption As String = DialogAddOption.ComboBoxOptionList.SelectedItem("Option").ToString If Not ListBoxNoMADHomeSharesOptions.Items.Contains(NewOption) Then ListBoxNoMADHomeSharesOptions.Items.Add(NewOption) @@ -34,8 +36,7 @@ Public Class DialogSettings End Sub Private Sub ButtonNoMADDefaultsAddOption_Click(sender As Object, e As EventArgs) Handles ButtonNoMADDefaultsAddOption.Click - Dim result As DialogResult = DialogAddOption.ShowDialog() - If result = DialogResult.OK Then + If DialogAddOption.ShowDialog() = DialogResult.OK Then Dim NewOption As String = DialogAddOption.ComboBoxOptionList.SelectedItem("Option").ToString If Not ListBoxNoMADDefaultsOptions.Items.Contains(NewOption) Then ListBoxNoMADDefaultsOptions.Items.Add(NewOption) @@ -75,4 +76,44 @@ Public Class DialogSettings ListBoxNoMADHomeSharesGroups.Items.Remove("All") End If End Sub + + Private Sub ButtonCreateNewPolicy_Click(sender As Object, e As EventArgs) Handles ButtonCreateNewPolicy.Click + If DialogNewPolicy.ShowDialog() = DialogResult.OK Then + Dim strGPOName As String = DialogNewPolicy.TextBoxPolicyName.Text + Dim strBackupID As String = "{81002162-2BD8-4088-9B10-A626FBF65A90}" + + Dim gpm As New GPM + Dim gpc As GPMConstants = gpm.GetConstants + Dim gpd As GPMDomain = gpm.GetDomain(GroupPolicyNetworkLocations.strDomainName, "", gpc.UseAnyDC) + + Dim policy As GPMGPO = gpd.CreateGPO() + policy.DisplayName = strGPOName + + Dim strGPOBackupPath As String = Environment.GetEnvironmentVariable("TEMP") + "\NewGPO\" + + If (Directory.Exists(strGPOBackupPath)) Then + Directory.Delete(strGPOBackupPath, True) + Do While Directory.Exists(strGPOBackupPath) + Threading.Thread.Sleep(500) + Loop + End If + + If (Not Directory.Exists(strGPOBackupPath)) Then + Directory.CreateDirectory(strGPOBackupPath) + End If + + File.WriteAllBytes(strGPOBackupPath + "\SampleGPO.zip", My.Resources.SampleGPO) + + ZipFile.ExtractToDirectory(strGPOBackupPath + "\SampleGPO.zip", strGPOBackupPath) + + Dim policyBackupDir As GPMBackupDir = gpm.GetBackupDir(strGPOBackupPath + "\SampleGPO") + Dim policyBackup As GPMBackup = policyBackupDir.GetBackup(strBackupID) + + policy.Import(0, policyBackup) + + GroupPolicyNetworkLocations.RefreshPolicyList() + + ComboBoxGroupPolicies.SelectedValue = policy.ID + End If + End Sub End Class diff --git a/GroupPolicyNetworkLocations/GroupPolicyNetworkLocations.vb b/GroupPolicyNetworkLocations/GroupPolicyNetworkLocations.vb index e2f2f32..8aba629 100644 --- a/GroupPolicyNetworkLocations/GroupPolicyNetworkLocations.vb +++ b/GroupPolicyNetworkLocations/GroupPolicyNetworkLocations.vb @@ -97,7 +97,7 @@ Public Class GroupPolicyNetworkLocations ' Use the Active Directory domain that the computer is joined to Dim objDomain As ActiveDirectory.Domain = ActiveDirectory.Domain.GetComputerDomain() - Dim strDomainName As String = objDomain.Name + Friend strDomainName As String = objDomain.Name Dim regUserSettings As RegistryKey Dim XMLIniFiles, XMLFolders, XMLShortcuts As New XmlDocument() @@ -627,7 +627,12 @@ Public Class GroupPolicyNetworkLocations Dim strUID As String = Folder.Attributes("uid").Value Dim timeModified As DateTime = Folder.Attributes("changed").Value Dim strShareName As String = Folder.Attributes("name").Value - Dim strDescription As String = Folder.Attributes("desc").Value + Dim strDescription As String + Try + strDescription = Folder.Attributes("desc").Value + Catch + strDescription = "" + End Try Dim rowNetLoc, rowGroup, rowOption As DataRow ' Add data to row Try @@ -772,7 +777,7 @@ Public Class GroupPolicyNetworkLocations changesSaved = False End Sub - Private Sub RefreshPolicyList() + Friend Sub RefreshPolicyList() ' Remove any old polices from the table tableGroupPolicies.Clear() diff --git a/GroupPolicyNetworkLocations/GroupPolicyNetworkLocations.vbproj b/GroupPolicyNetworkLocations/GroupPolicyNetworkLocations.vbproj index 0ce16b6..b5c696e 100644 --- a/GroupPolicyNetworkLocations/GroupPolicyNetworkLocations.vbproj +++ b/GroupPolicyNetworkLocations/GroupPolicyNetworkLocations.vbproj @@ -25,7 +25,7 @@ false true 0 - 1.2.0.0 + 1.3.0.0 false true true @@ -102,6 +102,8 @@ + + @@ -130,6 +132,12 @@ Form + + DialogNewPolicy.vb + + + Form + DialogAddOption.vb @@ -175,6 +183,9 @@ AboutBox.vb + + DialogNewPolicy.vb + DialogAddOption.vb @@ -207,6 +218,7 @@ Settings.Designer.vb + @@ -227,5 +239,16 @@ false + + + {C2F48CC2-305B-4672-BAA7-76A57738F48A} + 1 + 0 + 0 + tlbimp + False + True + + \ No newline at end of file diff --git a/GroupPolicyNetworkLocations/My Project/AssemblyInfo.vb b/GroupPolicyNetworkLocations/My Project/AssemblyInfo.vb index f746197..fb3c55b 100644 --- a/GroupPolicyNetworkLocations/My Project/AssemblyInfo.vb +++ b/GroupPolicyNetworkLocations/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + diff --git a/GroupPolicyNetworkLocations/My Project/Resources.Designer.vb b/GroupPolicyNetworkLocations/My Project/Resources.Designer.vb index 54ef015..5819d51 100644 --- a/GroupPolicyNetworkLocations/My Project/Resources.Designer.vb +++ b/GroupPolicyNetworkLocations/My Project/Resources.Designer.vb @@ -22,7 +22,7 @@ Namespace My.Resources ''' ''' A strongly-typed resource class, for looking up localized strings, etc. ''' - _ @@ -79,5 +79,15 @@ Namespace My.Resources Return CType(obj,Byte()) End Get End Property + + ''' + ''' Looks up a localized resource of type System.Byte[]. + ''' + Friend ReadOnly Property SampleGPO() As Byte() + Get + Dim obj As Object = ResourceManager.GetObject("SampleGPO", resourceCulture) + Return CType(obj,Byte()) + End Get + End Property End Module End Namespace diff --git a/GroupPolicyNetworkLocations/My Project/Resources.resx b/GroupPolicyNetworkLocations/My Project/Resources.resx index 513535b..078d693 100644 --- a/GroupPolicyNetworkLocations/My Project/Resources.resx +++ b/GroupPolicyNetworkLocations/My Project/Resources.resx @@ -124,4 +124,7 @@ ..\Resources\plist-cil.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\SampleGPO.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/GroupPolicyNetworkLocations/Resources/SampleGPO.zip b/GroupPolicyNetworkLocations/Resources/SampleGPO.zip new file mode 100644 index 0000000000000000000000000000000000000000..e11124f5dc61854911a8023f2645e6448bb70ad3 GIT binary patch literal 9964 zcmcJV1z42Z*2jmEZlok6r8}j&q(ua27`l-hx+JATx;vD1knUEbkuGTv5F|hFoVnul ze&_kVbB{C6%$j$edG`9f|Fzz=-@W!I$-%(l0B#;k9;^!AKm7TIbZu4jt!yoUQc8-< zN`L+i0dUWgRRJE%Qu_o70LX_10C0c$ot3_|nK97eIg^W(Wv;Tkjju4q1wG?&08pgS zm(tzrk>=6-fXh>T8SV-O{c)9#Cv%~C9UE_Yh>T6wM)hqxQV zkyWgCS35w~mJ?jyk8=K!TWFYnPq)?%%er;D)-2chVX)=Auqh0?0{MJk8Ppa=2bru% zp;_C3HQvco_%s!wN#c|2N1gPOybUKruPK(}1v#8bWULeMVZy%hvN(vrgFe3Twju~H zTzwnL!h3ZWWJ>BRe@`bqhX5FZzp)XMY|^=_$rT$F6`rvJUEuu2=ly0jUR@Vc^cmT6 zgeYq=@2qwx>gPoBk`G}s14=YFDycI;GqVA>4xQ3eQl3{1rD%T2$_Xb`?Z;*D;x+Gh z-@V(nCalRWRw=D%j9rK=@K#xcX_2v-m6X`g|$z#k(_%m8SvX8ewi&cXrx3kZv+ zADsFf4h%_EOY|gJsl?+c)uJ6A73Q(Za2NQhrDBrHV6`A|3VLkRbYRUK=Nn_RSJDU_ z<-dzxmE={7;ppdKllsWgE8ER={EgpCk16YQx33UwI1|*}Hrk=m7@fJ`d{2C_!-bM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