26.3 C
Dubai
Friday, December 2, 2022

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
Specialized in Microsoft Azure - Office 365 / Microsoft Exchange; conducted numerous projects worldwide in designing, supporting, and implementing messaging and virtualization infrastructure for medium-sized and large enterprises. Further, I am a Cloud Architect and 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?