none
Sharepoint and AD Groups

    Question

  • Hi guys,

    sorry for the newbie question, but i need your help with this issue. Is it possible to add some new user to some AD Group so that this User and this group would refresh automatically in Sharepoint (without having to add the user to the group in SP)?

    Greatful for any help,

    Seb

    • Moved by Mike Walsh FIN Monday, December 20, 2010 4:33 PM Nothing at all to do with Business Intelligence (From:SharePoint - Business Intelligence (pre-SharePoint 2010))
    Monday, December 20, 2010 2:40 PM

Answers

  • Yes, it is possible and normal practice.

    When you assign permissions to any AD security group in SharePoint, if you update the membership of group in AD it would reflect the same in SharePoint.

    By adding AD groups to SharePoint you minimize the security principles also. That will help you manage your SharePoint env batter.

     HTH

    • Marked as answer by Peng Lei Monday, December 27, 2010 8:38 AM
    Monday, December 20, 2010 5:13 PM
  • Hi,

     

    You can use the following lines of code to add the user in the user group automatically.

     

                                        SPGroup groupMembers = m_theWeb.SiteGroups["Members"];

                        groupMembers.AddUser("loginName", "email", "Name", "notes");

                        groupMembers.Update();

     

    Just replace the m_theWeb with your web object, "Members" with your site's members group name and "loginName" with actual login name of the user, "email" with actual email, "Name" with actual Name of user and notes with required notes for the user.

     

    I wish you every success in your important work.

    Best regards,

    David Hu

     

    • Marked as answer by Peng Lei Monday, December 27, 2010 8:38 AM
    Wednesday, December 22, 2010 2:46 AM

All replies

  • Yes, it is possible and normal practice.

    When you assign permissions to any AD security group in SharePoint, if you update the membership of group in AD it would reflect the same in SharePoint.

    By adding AD groups to SharePoint you minimize the security principles also. That will help you manage your SharePoint env batter.

     HTH

    • Marked as answer by Peng Lei Monday, December 27, 2010 8:38 AM
    Monday, December 20, 2010 5:13 PM
  • Hi,

     

    You can use the following lines of code to add the user in the user group automatically.

     

                                        SPGroup groupMembers = m_theWeb.SiteGroups["Members"];

                        groupMembers.AddUser("loginName", "email", "Name", "notes");

                        groupMembers.Update();

     

    Just replace the m_theWeb with your web object, "Members" with your site's members group name and "loginName" with actual login name of the user, "email" with actual email, "Name" with actual Name of user and notes with required notes for the user.

     

    I wish you every success in your important work.

    Best regards,

    David Hu

     

    • Marked as answer by Peng Lei Monday, December 27, 2010 8:38 AM
    Wednesday, December 22, 2010 2:46 AM