Home

Move AAD user to Selected group throup powershell

%3CLINGO-SUB%20id%3D%22lingo-sub-62922%22%20slang%3D%22en-US%22%3EMove%20AAD%20user%20to%20Selected%20group%20throup%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-62922%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20to%20move%20AAD%20users%20into%20selected%20security%20group%20in%20AzureActiveDirectory%20through%20PowerShell.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%20am%20able%20to%20connect%20AZUREAD%20through%20powershell%2C%20but%20am%20not%20able%20to%20get%20my%20users%20list%20and%20Group%20name.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20give%20me%20your%20valuable%20suggestions.%3C%2FP%3E%3CP%3EHow%20we%20can%20move%20users%20to%20a%20group%20in%20AAD%20using%20Powershell.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eregards%2C%3C%2FP%3E%3CP%3EAnil%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-62922%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20AD%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-63047%22%20slang%3D%22en-US%22%3ERe%3A%20Move%20AAD%20user%20to%20Selected%20group%20throup%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-63047%22%20slang%3D%22en-US%22%3E%3CP%3EI%20think%20you%20asked%20the%20same%20question%20on%20the%20Azure%20AD%20forums%20over%20at%20MSDN%2C%20no%3F%20Did%20you%20check%20my%20reply%20there%3F%20To%20do%20the%20same%20task%20via%20PowerShell%2C%20you%20can%20use%20the%20following%20cmdlets%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-MsolUser%20to%20list%20the%20users%20in%20question%20and%20get%20the%20ID%3C%2FP%3E%3CP%3EGet-MsolGroup%20to%20get%20the%20Group%20ID%3C%2FP%3E%3CP%3EAdd-MsolGroupMember%20to%20add%20the%20users%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example%2C%20once%20you%20have%20the%20Group%20ID%20and%20the%20user%20ID%2C%20you%20can%20use%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdd-MsolGroupMember%20-GroupObjectId%20a1813eff-a80b-4ac9-bbdc-8e0821b76809%20-GroupMemberObjectId%2093e15856-895f-43a8-9d60-23b343c26dae%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20you%20can%20see%2C%20the%20cmdlets%20are%20not%20very%20user%20friendly%2C%20so%20you%20might%20want%20to%20stick%20to%20the%20UI.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Anilkumar Murakonda
Occasional Visitor

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

1 Reply

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.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
38 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies