This PowerShell script allows to export the members of a Workplace group to a XLSX file.
-
Create a new Custom Integration in the Workplace Admin Panel: Create a custom Integration.
This requires at least "Manage Groups" and "Read User Emails" permissions. Take note of the Access Token. -
Create a file named
accessToken.js
with the following content:{ "accessToken" : "YOUR-ACCESS-TOKEN" }
-
Find your GroupId. Go in a browser to the Workplace group you would like to extract members from and take note of the GroupId from the URL you see in the browser bar:
https://INSTANCE-NAME.facebook.com/groups/GROUP-ID
-
Run the script by passing the GroupId and
accessToken.js
file as input:./exportGroupMembers.ps1 -GroupId THIS-IS-A-GROUP-ID -WPAccessToken accessToken.js
Here are the details of the passed params:
Parameter Description Type Required GroupId The ID of the group String Yes WPAccessToken The path for the JSON file with the access token String Yes -
A file named
members-[GroupId].xlsx
will be created in the same folder where your run the script. It will haveName
,Id
,Email
,Administator
columns.
I've get an error when trying to write the XLSX file - the error messages says
The property 'email' cannot be found on this object. Verify that the property exists and can be set.
Any idea how to fix this?