From b8845f1f23dbdcf2d26cfcffd7e124a4a1468a45 Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Sun, 22 Nov 2020 22:27:01 +0100 Subject: [PATCH] Repair-GPOZaurrNetLogonOwner update --- Public/Repair-GPOZaurrNetLogonOwner.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Public/Repair-GPOZaurrNetLogonOwner.ps1 b/Public/Repair-GPOZaurrNetLogonOwner.ps1 index a8347e2..38ecde6 100644 --- a/Public/Repair-GPOZaurrNetLogonOwner.ps1 +++ b/Public/Repair-GPOZaurrNetLogonOwner.ps1 @@ -17,18 +17,18 @@ $Principal = $Identity.Name $getGPOZaurrNetLogonSplat = @{ - OwnerOnly = $true - Forest = $Forest - IncludeDomains = $IncludeDomains - ExcludeDomains = $ExcludeDomains + OwnerOnly = $true + Forest = $Forest + IncludeDomains = $IncludeDomains + ExcludeDomains = $ExcludeDomains ExtendedForestInformation = $ExtendedForestInformation } - Get-GPOZaurrNetLogon @getGPOZaurrNetLogonSplat | Select-Object -First $LimitProcessing | Where-Object { + Get-GPOZaurrNetLogon @getGPOZaurrNetLogonSplat -Verbose | Where-Object { if ($_.OwnerSid -ne 'S-1-5-32-544') { $_ } - } | ForEach-Object { + } | Select-Object -First $LimitProcessing | ForEach-Object { if ($PSCmdlet.ShouldProcess($_.FullName, "Setting NetLogon Owner to $($Principal)")) { Set-FileOwner -JustPath -Path $_.FullName -Owner $Principal -Verbose:$true -WhatIf:$WhatIfPreference }