A windows application to download all G Suite email to a pst file.
Obtain a copy of the GmailToPST.zip file. Unzip to a directory. Open a command line window and navigate to that directory.
Perform the following steps before running:
- Log in to your Google admin account
- Navigate to (https://console.developers.google.com/start/api?id=gmail&credential=service-account).
- Choose create a project and click continue
- When project is created and API enabled click "Go to credentials".
- In step 1 of the Add credentials to your project page click the service Account hyperlink to skip the Credentials wizard
- Click the Create Service Account button
- Enter a service account name e.g. gmailtopst
- Under the role drop down choose Project -> Owner
- Check the Furnish a new private key check box
- Choose the P12 Key type
- Check the Enable G Suite Domain-wide Delegation check box
- Enter a product name in the Product name for the consent screen field e.g. Gmail to PST file exporter.
- Click Create
- The Save as dialog window will open, navigate to the same directory as the extracted GmailToPst.exe and click Save Your new public/private key pair is generated and downloaded to your machine; it serves as the only copy of this key. You are responsible for storing it secure.
- The service account has now been created, click Close
- Take note of the service account ID as this will be used later in step 17
- Click on the View Client ID link to the right of the Service account Key Creation date.
- When prompted click save to save the OAuth 2.0 client ID details
- Take note of the Client ID from the OAuth 2.0 client
- Navigate to the Admin console at admin.google.com and then Security
- Click on Show more and then Advanced settings
- Click on Manage API client access
- On the Manage API client access page put the client ID from point 14 in the Client Name field and put at least https://www.googleapis.com/auth/gmail.readonly in the API scopes field and click Authorize
When you run the program for the first time you need to specify the service account email address that can be obtained after step 9 above, it will be in the form of (guid)[email protected]
- Run the program with the following arguments GmailToPst.exe -e [email protected] -s (guid)[email protected]
All subsequent runs will only need the -e user's email argument.