diff --git a/Public/Get-GPOZaurrNetlogon.ps1 b/Public/Get-GPOZaurrNetlogon.ps1 index 024774e..d9242cd 100644 --- a/Public/Get-GPOZaurrNetlogon.ps1 +++ b/Public/Get-GPOZaurrNetlogon.ps1 @@ -2,9 +2,14 @@ [cmdletBinding(DefaultParameterSetName = 'Default')] param( [parameter(ParameterSetName = 'OwnerOnly')][switch] $OwnerOnly, - [parameter(ParameterSetName = 'SkipOwner')][switch] $SkipOwner + [parameter(ParameterSetName = 'SkipOwner')][switch] $SkipOwner, + + [alias('ForestName')][string] $Forest, + [string[]] $ExcludeDomains, + [alias('Domain', 'Domains')][string[]] $IncludeDomains, + [System.Collections.IDictionary] $ExtendedForestInformation ) - $ForestInformation = Get-WinADForestDetails -Extended + $ForestInformation = Get-WinADForestDetails -Extended -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation $FilesAll = foreach ($Domain in $ForestInformation.Domains) { $Path = -join ("\\", $Domain, '\Netlogon') $PathOnSysvol = -join ("\\", $Domain, "\SYSVOL\", $Domain, "\Scripts") diff --git a/Public/Repair-GPOZaurrNetLogonOwner.ps1 b/Public/Repair-GPOZaurrNetLogonOwner.ps1 index 09c772e..a8347e2 100644 --- a/Public/Repair-GPOZaurrNetLogonOwner.ps1 +++ b/Public/Repair-GPOZaurrNetLogonOwner.ps1 @@ -15,7 +15,16 @@ return } $Principal = $Identity.Name - Get-GPOZaurrNetLogon -OwnerOnly | Select-Object -First $LimitProcessing | Where-Object { + + $getGPOZaurrNetLogonSplat = @{ + OwnerOnly = $true + Forest = $Forest + IncludeDomains = $IncludeDomains + ExcludeDomains = $ExcludeDomains + ExtendedForestInformation = $ExtendedForestInformation + } + + Get-GPOZaurrNetLogon @getGPOZaurrNetLogonSplat | Select-Object -First $LimitProcessing | Where-Object { if ($_.OwnerSid -ne 'S-1-5-32-544') { $_ } diff --git a/README.md b/README.md index 00d2eb3..4420b1d 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,9 @@ That's it. Whenever there's a new version, you run the command, and you can enjo ## Changelog -- 0.0.69 - Unreleased +- 0.0.69 - 28.10.2020 - Added `Repair-GPOZaurrNetLogonOwner` + - Improved `Invoke-GPOZaurr` (WIP) - 0.0.68 - 28.10.2020 - Renamed `Show-GPOZaurr` to `Invoke-GPOZaurr` - Renamed `Invoke-GPOZaurr` to `Invoke-GPOZaurrContent`