Skip to content

Commit

Permalink
Merge pull request #76 from ActiveDirectoryManagementFramework/develo…
Browse files Browse the repository at this point in the history
…pment

1.8.199
  • Loading branch information
FriedrichWeinmann authored Sep 27, 2023
2 parents 97f092c + 1a1ed0c commit 2ff839d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DomainManagement/DomainManagement.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RootModule = 'DomainManagement.psm1'

# Version number of this module.
ModuleVersion = '1.8.198'
ModuleVersion = '1.8.199'

# ID used to uniquely identify this module
GUID = '0a405382-ebc2-445b-8325-541535810193'
Expand Down
4 changes: 4 additions & 0 deletions DomainManagement/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.8.199 (2023-09-27)

- Fix: Groups - When renaming a group from a previous name, it will not find other updates to apply

## 1.8.198 (2023-05-15)

- Upd: Acl - Will no longer try to enable inheritance for objects protected under the AdminSDHolder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@
if ($domain.DomainMode -lt $desiredLevel)
{
New-TestResult -ObjectType DomainLevel -Type Raise -Identity $domain -Server $Server -Configuration ([pscustomobject]$tempConfiguration) -ADObject $domain -Changed (
New-AdcChange -Property DomainLevel -OldValue $domain.DomainMode -NewValue $tempConfiguration['DesiredLevel'] -Identity $domain -Type DomainLevel
New-AdcChange -Property DomainLevel -OldValue $domain.DomainMode -NewValue $tempConfiguration['DesiredLevel'] -Identity $domain -Type DomainLevel -ToString {
{ '{0}: {1} -> {2}' -f $this.Identity, $this.Old, $this.New }
}
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion DomainManagement/functions/groups/Register-DMGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
.PARAMETER Scope
The scope of the group.
Use DomainLocal for groups that grrant direct permissions and Global for role groups.
Use DomainLocal for groups that grant direct permissions and Global for role groups.
.PARAMETER Category
Whether the group should be a security group or a distribution group.
Expand Down
9 changes: 7 additions & 2 deletions DomainManagement/functions/groups/Test-DMGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
#endregion Group that needs to be removed

#region Groups that don't exist but should | Groups that need to be renamed
# Flag to avoid duplicate renames in case of OldNames
$noNameUpdate = $false
try { $adObject = Get-ADGroup @parameters -Identity $resolvedName -Properties Description -ErrorAction Stop }
catch {
$oldGroups = foreach ($oldName in ($groupDefinition.OldNames | Resolve-String)) {
Expand All @@ -79,7 +81,8 @@
1 {
New-TestResult @resultDefaults -Type Rename -ADObject $oldGroups -Changed (New-AdcChange -Identity $adObject -Property Name -OldValue $oldGroups.Name -NewValue $resolvedName)
$oldNamesFound += $oldGroups.Name
continue main
$noNameUpdate = $true
$adObject = $oldGroups
}
#endregion Case: One old version present

Expand Down Expand Up @@ -108,7 +111,9 @@
Compare-Property @compare -Property Description -Resolve
Compare-Property @compare -Property Category -ADProperty GroupCategory
Compare-Property @compare -Property Scope -ADProperty GroupScope
Compare-Property @compare -Property Name -Resolve
if (-not $noNameUpdate) {
Compare-Property @compare -Property Name -Resolve
}
$ouPath = ($adObject.DistinguishedName -split ",", 2)[1]
if ($ouPath -ne (Resolve-String -Text $groupDefinition.Path)) {
$null = $changes.Add((New-Change -Property Path -OldValue $ouPath -NewValue (Resolve-String -Text $groupDefinition.Path) -Identity $adObject -Type Group))
Expand Down

0 comments on commit 2ff839d

Please sign in to comment.