mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-08-31 04:37:57 +00:00
Repair-GPOZaurrNetLogonOwner update
This commit is contained in:
@@ -17,18 +17,18 @@
|
|||||||
$Principal = $Identity.Name
|
$Principal = $Identity.Name
|
||||||
|
|
||||||
$getGPOZaurrNetLogonSplat = @{
|
$getGPOZaurrNetLogonSplat = @{
|
||||||
OwnerOnly = $true
|
OwnerOnly = $true
|
||||||
Forest = $Forest
|
Forest = $Forest
|
||||||
IncludeDomains = $IncludeDomains
|
IncludeDomains = $IncludeDomains
|
||||||
ExcludeDomains = $ExcludeDomains
|
ExcludeDomains = $ExcludeDomains
|
||||||
ExtendedForestInformation = $ExtendedForestInformation
|
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') {
|
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)")) {
|
if ($PSCmdlet.ShouldProcess($_.FullName, "Setting NetLogon Owner to $($Principal)")) {
|
||||||
Set-FileOwner -JustPath -Path $_.FullName -Owner $Principal -Verbose:$true -WhatIf:$WhatIfPreference
|
Set-FileOwner -JustPath -Path $_.FullName -Owner $Principal -Verbose:$true -WhatIf:$WhatIfPreference
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user