From 059246a506ca4b4a9809e611fc2379c37c2af2c5 Mon Sep 17 00:00:00 2001 From: Friedrich Weinmann Date: Thu, 11 Jan 2024 11:18:43 +0100 Subject: [PATCH 1/2] fixes --- ADMF/changelog.md | 5 +++++ ADMF/functions/Set-AdmfContext.ps1 | 2 +- ADMF/internal/scriptblocks/scriptblocks.ps1 | 5 +---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ADMF/changelog.md b/ADMF/changelog.md index b498ba5..debd42c 100644 --- a/ADMF/changelog.md +++ b/ADMF/changelog.md @@ -1,5 +1,10 @@ # Changelog +## ??? + +- Fix: Group Policy - does not respect "MayModify" +- Fix: Export-AdmfGpo - incorrect type validation + ## 1.13.98 (2023-09-27) - Upd: Set-AdmfContext - added context name to Certificate component diff --git a/ADMF/functions/Set-AdmfContext.ps1 b/ADMF/functions/Set-AdmfContext.ps1 index b15e549..7b1db15 100644 --- a/ADMF/functions/Set-AdmfContext.ps1 +++ b/ADMF/functions/Set-AdmfContext.ps1 @@ -362,7 +362,7 @@ $file = Get-Item $exportDataPath Write-PSFMessage -Level Debug -String 'Set-AdmfContext.Context.Loading' -StringValues $ContextObject.Name, 'Group Policy', $file.FullName try { - $dataSet = Import-PSFPowerShellDataFile -LiteralPath $file.FullName -Unsafe -ErrorAction Stop | ConvertTo-PSFHashtable -Include DisplayName, Description, ID, ExportID, WMiFilter + $dataSet = Import-PSFPowerShellDataFile -LiteralPath $file.FullName -Unsafe -ErrorAction Stop | ConvertTo-PSFHashtable -Include DisplayName, Description, ID, ExportID, WMiFilter, MayModify foreach ($policyEntry in $dataSet) { Register-DMGroupPolicy @policyEntry -Path "$($ContextObject.Path)\domain\grouppolicies\$($policyEntry.ID)" -ContextName $ContextObject.Name } diff --git a/ADMF/internal/scriptblocks/scriptblocks.ps1 b/ADMF/internal/scriptblocks/scriptblocks.ps1 index 985dbbd..eb101e2 100644 --- a/ADMF/internal/scriptblocks/scriptblocks.ps1 +++ b/ADMF/internal/scriptblocks/scriptblocks.ps1 @@ -12,10 +12,7 @@ Set-PSFScriptblock -Name 'ADMF.ScriptBlockName' -Scriptblock { #> Set-PSFScriptblock -Name 'ADMF.Validate.Type.Gpo' -Scriptblock { foreach ($item in $_) { - if ( - -not ($item -is [Microsoft.GroupPolicy.Gpo]) -or - ($item.PSObject.TypeNames -contains 'Microsoft.GroupPolicy.Gpo') - ) { return $false } + if ($item.PSObject.TypeNames -notcontains 'Microsoft.GroupPolicy.Gpo') { return $false } } $true } From 36c9961439fc8a4bd85fd88e295aa2ce8ae031ac Mon Sep 17 00:00:00 2001 From: FriedrichWeinmann Date: Fri, 12 Jan 2024 08:43:26 +0100 Subject: [PATCH 2/2] version update --- ADMF/ADMF.psd1 | 10 +++++----- ADMF/changelog.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ADMF/ADMF.psd1 b/ADMF/ADMF.psd1 index 716c35f..e9d2c7f 100644 --- a/ADMF/ADMF.psd1 +++ b/ADMF/ADMF.psd1 @@ -3,7 +3,7 @@ RootModule = 'ADMF.psm1' # Version number of this module. - ModuleVersion = '1.13.98' + ModuleVersion = '1.13.100' # ID used to uniquely identify this module GUID = '43f2a890-942f-4dd7-bad0-b774b44ea849' @@ -26,15 +26,15 @@ # Modules that must be imported into the global environment prior to importing # this module RequiredModules = @( - @{ ModuleName = 'PSFramework'; ModuleVersion = '1.7.270' } - @{ ModuleName = 'ADSec'; ModuleVersion = '1.0.0' } + @{ ModuleName = 'PSFramework'; ModuleVersion = '1.10.318' } + @{ ModuleName = 'ADSec'; ModuleVersion = '1.0.1' } @{ ModuleName = 'string'; ModuleVersion = '1.1.3' } @{ ModuleName = 'ResolveString'; ModuleVersion = '1.0.0' } @{ ModuleName = 'Principal'; ModuleVersion = '1.0.0' } @{ ModuleName = 'ADMF.Core'; ModuleVersion = '1.1.9' } @{ ModuleName = 'DCManagement'; ModuleVersion = '1.2.25' } - @{ ModuleName = 'DomainManagement'; ModuleVersion = '1.8.199' } - @{ ModuleName = 'ForestManagement'; ModuleVersion = '1.5.66' } + @{ ModuleName = 'DomainManagement'; ModuleVersion = '1.8.202' } + @{ ModuleName = 'ForestManagement'; ModuleVersion = '1.5.73' } ) # Assemblies that must be loaded prior to importing this module diff --git a/ADMF/changelog.md b/ADMF/changelog.md index debd42c..f17dbcb 100644 --- a/ADMF/changelog.md +++ b/ADMF/changelog.md @@ -1,6 +1,6 @@ # Changelog -## ??? +## 1.13.100 (2024-01-12) - Fix: Group Policy - does not respect "MayModify" - Fix: Export-AdmfGpo - incorrect type validation