From 2d0c75c8630ca40c1b8f2cf04e0152e61ec25a57 Mon Sep 17 00:00:00 2001 From: vreguibar Date: Tue, 8 Oct 2024 10:39:18 +0200 Subject: [PATCH] Fix error not found for GPP --- Public/New-CentralItOU.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Public/New-CentralItOU.ps1 b/Public/New-CentralItOU.ps1 index fd9e856..a4e60c4 100644 --- a/Public/New-CentralItOU.ps1 +++ b/Public/New-CentralItOU.ps1 @@ -1242,7 +1242,7 @@ [String]$PsoName = $confXML.n.Admin.PSOs.ItAdminsPSO.Name - $PSOexists = Get-ADFineGrainedPasswordPolicy -Filter { name -eq $PsoName } + $PSOexists = Get-ADFineGrainedPasswordPolicy -Filter { name -like $PsoName } if (-not($PSOexists)) { Write-Verbose -Message ('Creating {0} PSO.' -f $PsoName) @@ -1265,7 +1265,7 @@ $PSOexists = New-ADFineGrainedPasswordPolicy @Splat If ( -not $PSOexists ) { - $PSOexists = Get-ADFineGrainedPasswordPolicy -Filter { name -eq $PsoName } + $PSOexists = Get-ADFineGrainedPasswordPolicy -Filter { name -like $PsoName } } } # End If PSO exists @@ -1405,7 +1405,7 @@ [String]$PsoName = $confXML.n.Admin.PSOs.ServiceAccountsPSO.Name - $PSOexists = Get-ADFineGrainedPasswordPolicy -Filter { name -eq $PsoName } + $PSOexists = Get-ADFineGrainedPasswordPolicy -Filter { name -like $PsoName } if (-not($PSOexists)) { Write-Verbose -Message ('Creating {0} PSO.' -f $PsoName) @@ -1427,7 +1427,7 @@ } $PSOexists = New-ADFineGrainedPasswordPolicy @Splat If (-not $PSOexists) { - $PSOexists = Get-ADFineGrainedPasswordPolicy -Filter { cn -eq $PsoName } + $PSOexists = Get-ADFineGrainedPasswordPolicy -Filter { name -like $PsoName } } #$PSOexists = Get-ADFineGrainedPasswordPolicy -Identity $PsoName