mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-08-04 16:09:50 +00:00
21 lines
597 B
PowerShell
21 lines
597 B
PowerShell
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
|
|
|
$LImitProcessing = 2
|
|
|
|
# check what is there now
|
|
$GPOs = Get-GPOZaurr #-GPOName 'New Group Policy Object'
|
|
$GPOs | Format-Table DisplayName, Owner, OwnerSID
|
|
$Count = 0
|
|
|
|
# loop thru all GPOS (or use LimitProcessing)
|
|
foreach ($GPO in $GPOS) {
|
|
$Count++
|
|
Set-GPOZaurrOwner -GPOID $GPO.GUID -Verbose -Principal 'przemyslaw.klys@evotec.pl' #-WhatIf
|
|
if ($Count -eq $LImitProcessing) {
|
|
break
|
|
}
|
|
}
|
|
|
|
# Confirm what changed
|
|
$GPOs = Get-GPOZaurr #-GPOName 'New Group Policy Object'
|
|
$GPOs | Format-Table DisplayName, Owner, OwnerSID |