Extract list of Yammer Group Members ?


Because it is requested for age and numerous people ask for, I am sharing a workaround to allow you to extract the list of members within your yammer group (when you have 10 it is quite easy to undertake, when you have 3k user within a yammer group, good luck :)


Before going forward and if you need that feature (get the list of yammer group member), don't forget vote for it to ensure it will be an OOTB feature, here the link : Allow Admin/Group Admin to Export Yammer Group Members


Now you vote for it, here the workaround you are looking for (a tiny powershell script that run on Windows computer), the sole thing you need is your security token (obfuscate in the example because a security token allow access to your network and you should never share it with anyone :)


# Name : getYammerGroupMembers.ps1
# Description : A tiny powershell script to extract yammer group members as a csv file
# Typical usage : you need to not send an Announcement but an email to all group members
# or you need to make the list of all group member to make some gap analysis with some other list
# or you need to make the list to invite in bulk all group members into another one (ie. merge 2 groups)
# Important : For confidentiality reason, the $Token value was obfuscate. 
# You need to replace the $Token value by your own private network value.
# Warning : never ever, share a script on which your secure token is in clear, 
# else you give access to your private network ...
# Usage : you need to change the $GroupId value (5258215) in this example with the Yammer Group ID
# of the group on which you want to extract group members. How to get the Group ID ? it is quite simple
# Let take this example of URL : https://www.yammer.com/itpronetwork/#/threads/inGroup?type=in_group&feedId=5258215
# This Yammer Group have as Group ID : 5258215


$Token = "5****-A********************Q"

$Headers = @{
        "Authorization" = "Bearer "+$Token
$GroupCycle = 1
  $GetMoreGroupsUri = "https://www.yammer.com/api/v1/users/in_group/$GroupId.xml?page=$GroupCycle"
  Write-Host ("REST API CALL : $GetMoreGroupsUri")
  [xml]$Xml = ((Invoke-WebRequest -Uri $GetMoreGroupsUri -Method Get -Headers $Headers).content)
  $YammerGroups += $Xml.response.users.user
  $GroupCycle ++
  $GroupCount += $Xml.response.users.user.count
  Write-Host ("GROUPMEMBER COUNT : $GroupCount")
While ($Xml.response.users.user.count -gt 0)

$YammerGroups | Export-Csv "$GroupId.csv" -Delimiter ";" 
0 Replies