Is it possible to add an Active Directory object to a security group via a group policy

steven gamble 1 Reputation point
2020-09-14T21:21:24.313+00:00

The intent is to automatically add an Active Directory object to an Active Directory security group when it is created in or moved into a specific OU. I currently have a PowerShell script that will retrieve each object and add them to the security group if they aren't already a member, but would prefer to have it occur near immediately when the object is created in or moved into the OU vice waiting for a manually run, or scheduled task run of the script.

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,323 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Fan Fan 15,326 Reputation points Microsoft Vendor
    2020-09-15T00:32:40.867+00:00

    Hi,
    As you mentioned above,a scheduled task to run the script can be considered to achieve your goal .
    But for the schedule task ,the program was run at the time you scheduled ,not the time the new objects were created.
    Even the for the Immediate Tasks, the scripts run as soon as each client refreshes its Group Policy. While this means the "immediate" in the Immediate Task still requires a period of time equal to your Group Policy refresh interval.
    This means it is possible to add an Active Directory object to a security group via a group policy automatically, but need to wait some some for the group policy to be refreshed or at the scheduled time .

    Fan


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.