Skip to content

Instantly share code, notes, and snippets.

@dlundgren
Last active October 6, 2016 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlundgren/716397756bb01fe225adb56e8df81c15 to your computer and use it in GitHub Desktop.
Save dlundgren/716397756bb01fe225adb56e8df81c15 to your computer and use it in GitHub Desktop.
Change a google user password
<?php
// composer require --no-dev google/apiclient
// composer require --no-dev google/apiclient-services
require_once __DIR__ . '/vendor/autoload.php';
$config = [
// configure stuff here for Google_Client
];
$dir = new Google_Service_Directory(new Google_Client($config));
$user = $dir->users->get($username);
$user->setPassword($newpassword);
$dir->users->update($username, $user);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment