none
Creating an AD dynamic group, based on OU membership - refreshing group based on OU RRS feed

  • Question

  • Creating an AD dynamic group, based on OU membership - refreshing group based on OU

    The goals here:

    1) Create a single script (PS, VBS, whatever)

    2) Remove all members from a group

    3) Listing all current users inside an OU and put all thoses users inside the "emptied" group on 2)

    It´s possible?

    I found some scattered scripts, but some VBs, some PS, sometimes using DS*.exe, but it´s hard to find a single entity doing all this, but maybe combining two separated scripts (2 and 3) could do the trick

    Any ideas?

    Monday, July 15, 2019 5:43 PM

Answers

  • This PowerShell script in the Gallery should help:

    https://gallery.technet.microsoft.com/Update-Shadow-Group-with-9ee6336f

    The script removes all users from the specified group that are no longer in the specified OU (or OUs). It adds all users in the OU that are not in the group. The users are removed from the group in one bulk operation, and the users are added in one bulk operation. A detailed log file is created to document what was done.


    Richard Mueller - MVP Enterprise Mobility (Identity and Access)

    Monday, July 15, 2019 9:52 PM
    Moderator

All replies