adding user in group

sns 9,226 Reputation points
2020-08-07T09:29:58.34+00:00

We have Group called Domain\Tid in SharePoint site and this group is from AD.
I want one particular user to add in the group.

is there any power shell command for that? if yes please share it. Thank you.

SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,862 questions
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,021 Reputation points
    2020-08-10T07:56:25.407+00:00

    Hi @sns ,

    In SharePoint, AD group is different from SharePoint group. AD group is seen as a normal user in SharePoint.

    As a workaround, you could create a SharePoint group and add an AD group inside of the SharePoint group. This way, if you need to add additional users to your site in addition to those that already exist in AD group, you can add them easily by adding individual users to the SharePoint group, alongside the AD group. active-directory-groups-sharepoint-groups

    Below is powerShell to add user to a SharePoint group:

    New-SPUser -UserAlias "domain\user" -Web "http://sharepoint.crescent.com/sites/marketing" -Group "Marketing Owners"  
    

    Reference: add-user-to-sharepoint-group-with-powershell

    Besides, for the error when you post new question. I think you may have some codes in your question, you could use txt file to upload your log/code. You'd better submit a feedback here using the tag qna-feedback : https://learn.microsoft.com/en-us/answers/topics/qna-feedback.html


2 additional answers

Sort by: Most helpful
  1. Sharath Kumar Aluri 3,071 Reputation points
    2020-08-09T20:53:53.16+00:00

    You need to have Active Directory Tool installed in your machine or Active Directory access in order to add AD user in the AD Group, below powershell commands will help you to add the user.

    Import-Module ActiveDirectory
    
    Add-ADGroupMember -Identity "Sharath_Test" -Member Domain\username
    
    Get-ADGroupMember "Sharath_Test"
    

    Thanks & Regards,


  2. MichaelHan-MSFT 18,021 Reputation points
    2020-08-10T02:31:57.22+00:00

    Agree with Sharath. You could use command Add-ADGroupMember to add one user to to an Active Directory group. Reference: add-adgroupmember

    Note: you need to run this command in your AD server. Or you have to install Active Directory Management Tools in the sever.

    16631-8.png