From 84805cf134471f2993372bebc73a0878d681f760 Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Tue, 11 Jun 2024 14:49:49 +0200 Subject: [PATCH] Should fix partially #55 --- Public/Get-GPOZaurrInheritance.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Public/Get-GPOZaurrInheritance.ps1 b/Public/Get-GPOZaurrInheritance.ps1 index 933081b..32f5a58 100644 --- a/Public/Get-GPOZaurrInheritance.ps1 +++ b/Public/Get-GPOZaurrInheritance.ps1 @@ -15,6 +15,9 @@ .PARAMETER IncludeExcludedObjects Show excluded objets. Default disabled + .PARAMETER IncludeGroupPoliciesForBlockedObjects + Include Group Policies for Blocked Objects. Default disabled + .PARAMETER Exclusions Provide exclusions for OU's approved by IT. You can provide OU by canonical name or distinguishedName @@ -69,7 +72,7 @@ } if ($InheritanceInformation.BlockedInheritance -and $IncludeGroupPoliciesForBlockedObjects.IsPresent) { try { - $GPInheritance = Get-GPInheritance -Target $OU.distinguishedName -ErrorAction Stop + $GPInheritance = Get-GPInheritance -Target $OU.distinguishedName -ErrorAction Stop -Domain $InheritanceInformation.DomainName } catch { Write-Warning -Message "Get-GPOZaurrInheritance - Can't get GPInheritance for $($OU.distinguishedName). Error: $($_.Exception.Message)" continue