Assign User Membership from one account to another user account

Home Forums Scripting PowerShell Assign User Membership from one account to another user account

This topic contains 2 replies, has 2 voices, and was last updated by Avatar makavelli12 2 weeks, 6 days ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Avatar
    makavelli12
    Participant
    #623829

    Dear All,

    I have very limited PowerShell skills and so wanted to ask if anyone knows if it is possible to do the following with PowerShell:

    User A has group membership of 20 AD Groups:

    Group 1
    Group 2
    Group 3
    etc

    Now User B, has its own group membership but it also needs to have the same group membership like User A.

    Is there a PowerShell command that allows me to do this?

    Hope someone can help.

    Mak

    Avatar
    wullieb1
    Moderator
    #623875

    You can do it but the forums think i’m spamming it by posting a link to the solution.

    Get-ADPrincipalGroupMembership will get you the users groups that you need.

    Add-AdGroupMember will add the groups

    Pretty sure you should be able to work out where to go from here :)

    Avatar
    makavelli12
    Participant
    #623878

    Thanks wullieb1!!!

    Will try it.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.