Skip to content

Commit

Permalink
Splat command
Browse files Browse the repository at this point in the history
  • Loading branch information
vreguibar committed Jun 3, 2024
1 parent 0b33363 commit 9896796
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Public/New-CentralItOU.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,14 @@
$params.Add('thumbnailPhoto', $photo)
}

Set-ADUser -Identity $AdminName -TrustedForDelegation $false -AccountNotDelegated $true -Add $params -Server $env:COMPUTERNAME
$Splat = @{
Identity = $AdminName
TrustedForDelegation = $false
AccountNotDelegated = $true
Add = $params
Server = $env:COMPUTERNAME
}
Set-ADUser @Splat

Write-Verbose -Message 'Admin accounts created and secured.'

Expand Down Expand Up @@ -1100,7 +1107,7 @@
Move-ADObject -TargetPath $ItPrivGroupsOUDn -Identity $item.ObjectGUID

# Set back again the ProtectedFromAccidentalDeletion flag.
#The group has to be fetch again because of the previus move
#The group has to be fetch again because of the previous move
Set-ADObject -Identity $item.ObjectGUID -ProtectedFromAccidentalDeletion $true

#refresh the variable because DistinguishedName changed
Expand Down

0 comments on commit 9896796

Please sign in to comment.