Showing posts with label GAM. Show all posts
Showing posts with label GAM. Show all posts

Wednesday 2 January 2019

Export all groups with members list - GSuite

Or, How to export all GSuite groups with members list using GAM tool?
Or, Using GAM tool to export GSuite groups list with members
Or, Export GSuite groups with all members including all other details
Or, Export members, managers, created date, owners, name etc… of all groups in GSuite using GAM tool

Descriptions: GSuite is not having any feasibility on web GUI to export groups list in to a CSV file along with members, however, you can export groups one by one with members list from group’s properties advanced settings. This becomes really tedious when you have a large list of groups though.

To achieve this, you may think of trying GAM tool available at GitHub.

If you already have GAM tool installed on your machines, you may try the command given below to export all groups in a CSV file with the name and email addresses.

Steps: Exporting groups with members list into a CSV file

Open CMD and Locate to the directory where GAM tool is installed










Type the command given below and hit enter
-----------------------------------------------------------------------------------------------------------------------
gam print groups name description admincreated id aliases members owners managers settings > D:\temp\groups.csv
-----------------------------------------------------------------------------------------------------------------------





You can change the destination directory to your own convenient path. In my case its D:\temp

Cheers, write me back if you have any query or feedback on this.

Tuesday 18 December 2018

Deleting a single email from all mailboxes in GSuite using GAM tool

Or, How to delete a single email using GAM tool in GSuite?
Or, Delete a single email from all mailboxes in GSuite
Or, Email sent by mistake to all users, want to delete the specific email from everyone’s mailboxes

Descriptions: This is a very common scenario where someone in your organization sent an email by mistake to a ‘Distribution List’ which may contain 100-1000 or even more users. Now the role of administrator starts here.
The requirement here is to delete this particular email from every user’s mailbox without letting them know about this or without their intervention.
Take it easy, you can use below GAM command to get it done.

Prerequisite: You should have the Message ID of the email that you want to delete

Steps:
Open GAM CMD with administrative privilege, and Run below command to delete the specific email
gam all users delete messages query rfc822msgid:<Message_ID> doit

Example:-
gam all users delete messages query rfc822msgid:CAhshdghs79jo_J6XZimV_tywxjhshgQh2cZV-mQ@mail.gmail.com doit

Result:
-----------------------------------------------------------------------------------------------------------------------
Got 1 messages for user tsadmin@techiessphere.com
delete 1 messages
Got 0 messages for user tsuser@techiessphere.com
would try to delete 0 messages for user tsuser@techiessphere.com (max 1)
----------------------------------------------------------------------------------------------------------------------
Here in the above result section, you can see that the email was deleted from one affected user where it was found matched, and the command skipped the second user where there was no matched content/email found.


Cheers, please write me back if you have any query or feedback on this.