Adding a User to a Domain Group
Groups are not really all that interesting. About the only details that get modified in groups are the members. In this section, you'll learn about the steps involved in assigning domain users to domain groups.
The process of adding a user to a group is a little strange. Although it is true that groups have a member attribute, it is not easy to connect to the group, add the distinguished name attribute of the user to the member attribute, call the setinfo() method, and finish. Rather, the process requires us to first connect to the group. Then, use the add() method to add the adsPath to the member attribute, and then, don't bother calling setinfo().
Begin the AddUserToGroup.ps1 script with the param() statement, supplying ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access