Apr 18 2017
05:10 AM
- last edited on
Jan 14 2022
05:33 PM
by
TechCommunityAP
Apr 18 2017
05:10 AM
- last edited on
Jan 14 2022
05:33 PM
by
TechCommunityAP
Hi All,
I have to move AAD users into selected security group in AzureActiveDirectory through PowerShell.
However am able to connect AZUREAD through powershell, but am not able to get my users list and Group name.
Please give me your valuable suggestions.
How we can move users to a group in AAD using Powershell.
regards,
Anil
Apr 18 2017 11:16 AM
I think you asked the same question on the Azure AD forums over at MSDN, no? Did you check my reply there? To do the same task via PowerShell, you can use the following cmdlets:
Get-MsolUser to list the users in question and get the ID
Get-MsolGroup to get the Group ID
Add-MsolGroupMember to add the users
For example, once you have the Group ID and the user ID, you can use:
Add-MsolGroupMember -GroupObjectId a1813eff-a80b-4ac9-bbdc-8e0821b76809 -GroupMemberObjectId 93e15856-895f-43a8-9d60-23b343c26dae
As you can see, the cmdlets are not very user friendly, so you might want to stick to the UI.