27 C
Dubai
Saturday, November 23, 2024

Copy Azure AD Group Security group members to another group

Copy of the object ID of the source group

Get the members of the group using object ID to make sure you are on the right group

Get-AzureADGroupMember -ObjectId a8a3b9f5-3451-4e17-923c-06554e841f55 -All $true

Copy the object ID of the target group

Copy the target group object ID in the second object ID

(Get-AzureADGroupMember -ObjectId a8a3b9f5-3451-4e17-923c-06554e841f55 -All $true) | ForEach-Object {Add-AzureADGroupMember -ObjectId 37cc533e-17ac-4db5-b474-5c5f9a228ed5 -RefObjectId $_.ObjectID}

Now the Members have been copied from source to target Azure AD group

(Get-AzureADGroupMember -ObjectId a8a3b9f5-3451-4e17-923c-06554e841f55 -All $true).count
(Get-AzureADGroupMember -ObjectId 37cc533e-17ac-4db5-b474-5c5f9a228ed5 -All $true).count

Satheshwaran Manoharan
Satheshwaran Manoharanhttps://www.azure365pro.com
Award-winning Technology Leader with a wealth of experience running large teams and diversified industry exposure in cloud computing. From shipping lines to rolling stocks.In-depth expertise in driving cloud adoption strategies and modernizing systems to cloud native. Specialized in Microsoft Cloud, DevOps, and Microsoft 365 Stack and conducted numerous successful projects worldwide. Also, Acting as a Technical Advisor for various start-ups.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

× How can I help you?