Copy groups membership from a user to a new user

5even 56 Reputation points
2020-08-20T15:36:51.207+00:00

Hi guys,

is it possible to create a new user with help of a reference user. For example a new hire in the team Sales Department. I don't want to manually add all the groups the sales guys have. Is it possible to copy paste the groups somehow?

Thank you

Platform: Azure AD, O365

BG,

5even

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alfredo Revilla - Upwork Top Talent | IAM SWE SWA 27,526 Reputation points Moderator
    2020-08-20T16:23:26.367+00:00

    You can using the AzureAD powershell module like this:

    Get-AzureADUserMembership -ObjectId {source user object id}|foreach { Add-AzureADGroupMember -ObjectId $_.ObjectId -RefObjectId {new user object id} }

    --
    Please let us know if this answer was helpful to you. If so, please remember to mark it as the answer so that others in the community with similar questions can more easily find a solution.

    2 people found this answer helpful.

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.