LoicVeirman / HardenAD

Hardening Active Directory version 2
Other
258 stars 37 forks source link

[TS-LocalAdmins] Set-LocalAdmins.ps1 cannot work outside PDC #120

Closed lmeot-syn closed 3 months ago

lmeot-syn commented 3 months ago

Describe the bug All AD objects modification ran by the .ps1 script on standard DC cannot be achieved since the TS is ran under LOCALSYSTEM(DC Identity) and this Id does not have any modification right on PDC.

To Reproduce Steps to reproduce the behavior:

  1. Deploy the GPO on any DC but PDC
  2. Make the TS run by triggering it (moving AD Computer for ex)
  3. See event viewer for failed action

Expected behavior This script must work on any DC. We cannot deploy it centrally since the event ID needed to run the task are generated locally on DC.

Proposed Solution Change all call to variable $myPDC to localhost

LoicVeirman commented 3 months ago

Integrated to QuickFix August 2024 (on going)

LoicVeirman commented 3 months ago

Done.