none
How to get organization information from people and group column of sharepoint community site? RRS feed

  • Question

  • In SharePoint 2013 community site, Community members List, there is a column called Members which holds the Community Member Name. This is in fact a People and Group column which has the member's organization details. I want to another column called 'Department' and show the organization details of the employee. SO that I can export that to Excel to know tor participating organizations. Please advise.

    I tried exporting the items from Admin view to Excel but the members' organization details are not exported to Excel. Thanks in advance

    Thursday, July 2, 2020 9:43 AM

Answers

  • Hi,

    You could use rest api to get the person department.

    Demo:

    /_api/web/lists/getbytitle('Community Members')/items(1)?$select=Member/Department&$expand=Member

    Test Result:

    Best Regards,

    Amos


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.


    Monday, July 6, 2020 7:11 AM

All replies

  • Hi Roy,

    We should get user profile by UserProfileManager.

    Test demo for your reference:

    $SiteURL = "http://sp/sites/community"
    $ListName = "Community Members"               
    $FieldName="Member"
      
    #Get site and List objects
    $web = Get-SPWeb $SiteURL
    $list= $web.lists[$listName]
    $ServiceContext  = Get-SPServiceContext -site $SiteURL
    $UserProfileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext)
    
    $people=@()
    foreach ($Item in $list.Items)
    {
        #Get the People picker field value
        $Member = New-Object Microsoft.Sharepoint.SPFieldUserValue($Web,$Item[$FieldName])
    
          $UserProfile = $UserProfileManager.GetUserProfile($Member.User.LoginName)
    
          $people += New-Object PSObject -Property @{
                                    "Department" = $UserProfile["Department"]                                                            
                }
    }
    $people |Export-Csv -NoTypeInformation -Path "C:\\Temp\\testc.csv"
    

    Best Regards,

    Amos


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, July 3, 2020 2:39 AM
  • Thank you for the reply. I want this functionality to be used by my community site owners. Can I have similar implementation using JS instead of powershell? Probably on opening a page and clicking a button to get this details. Thanks
    • Edited by MC ROY Friday, July 3, 2020 2:05 PM
    Friday, July 3, 2020 2:04 PM
  • From the home page of your site collection, in the Community tools web part, click Community settings.

    In Auto-approval for permission requests, check the box next to Enable auto-approval.

    Note: The Enable auto-approval option is available only for communities that are root site collections and not available for community subsites.

    Disable auto approval
    From the home page of your site collection, in the Community tools web part, click Community settings.

    In Auto-approval for permission requests, clear the checkbox next to Enable auto-approval.

    Manage community group permissions
    A community site collection comes with four user groups, and each group has a different permission level:

    Community members have contribute permissions, which enable them to start discussions, reply to discussions, earn reputation points, and nominate replies as “best reply.”

    Community moderators have moderate permissions, which allow them to create and manage discussion categories, monitor and act upon member complaints, gift badges to members, and determine reputation ratings.

    Community owners have full control over a community. The can create and delete communities, assign permissions, participate in discussions, gift badges to members, and perform moderation tasks.

    Community visitors have read-only permissions. They can follow discussions but must become members before they can participate in discussions.

    Assign users to groups
    From the root of your site collection click Settings Small Settings gear that took the place of Site Settings. > Site settings.

    On the Site Settings page, under Users and Permissions, click People and groups.

    In the Quick Launch menu on the left side of the page, click More.

    Click the name of the group to which you’ll add members.

    On the People and Groups page, click New.

    Under Add people, type the names or email addresses of the members you want to add. You can also add distribution lists here so large groups of users are granted permission all at once.

    Click Share.

    Monitor community membership
    The community moderator, site owner, or site collection administrator are the only ones who can manage community membership.

    From the root of your site collection click Settings Small Settings gear that took the place of Site Settings. > site settings.

    On the Site Settings page, under Community Administration, click Manage Members.

    On the Community Members page notice that several different views are available:
    Members View: Displays member information, such as photo, name, and discussion statistics. This view can be sorted alphabetically or by top contributors. This is the same view that’s available to all members via the Members link in the Quick Launch on the left side of the page.

    Admin View: Includes photo, name, and join information along with a tally of the member’s discussions, replies, best replies, and reputation score. Also lists any badges that have

    New Members. Shows members who have recently joined. Clicking the member name or photo will take you to their My Site profile.

    Elipses (…). Provides additional view options such as Top Contributors and Single Member View. The single member view displays a record of ongoing activity by member. I hope this helps you in SharePoint Migration. Please mark it as an answer.
    Friday, July 3, 2020 2:09 PM
  • Hi Max-44, Your reply is nor related to my question.
    Sunday, July 5, 2020 8:07 AM
  • Hi,

    You could use rest api to get the person department.

    Demo:

    /_api/web/lists/getbytitle('Community Members')/items(1)?$select=Member/Department&$expand=Member

    Test Result:

    Best Regards,

    Amos


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.


    Monday, July 6, 2020 7:11 AM
  • Hi,

    Would you please provide us with an update on the status of your issue?

    If my reply helped you, you could mark it as the answer,so it may help other community members find the helpful information quickly.

    This “SharePoint 2013 - Development and Programming” Forum will be migrating to a new home on Microsoft Q&A, please refer to this sticky post for more details.

    Best Regards,

    Amos


    "SharePoint" forums will be migrating to a new home on Microsoft Q&A !
    We invite you to post new questions in the "SharePoint" forums' new home on Microsoft Q&A !

    Thursday, July 16, 2020 8:15 AM