3

I am creating AD accounts via a powershell script. It also adds a user to a second AD group. By default, this user is placed in the Domain Users group, which is the primary group. How can I...

  1. Determine the ID of the second AD group
  2. Set the primary group ID of the user to that of #1
  3. Delete the user from the Domain Users group (this should be easy once #1 and #2 are done).

My script is using [ADSI] commands to create the user & add them to the second group. I am not using any add ons such as MS-AD or Quest.

1 Answer 1

3

Looks like I asked too soon. This is what I was looking for.

Changing Primary Group with Powershell

Searching for "powershell primaryGroupToken" on Google is what did the trick.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .