Using PowerShell to reset passwords in Google Workspace

Step 1: Install the Google Admin SDK module

Ensure you have the required module by running the script below.

Install-Module GoogleWorkspace -Scope CurrentUser

Step 2: Authenticate to Google Admin API

Connect using API credentials. This allows PowerShell to communicate with Google Workspace.

Connect-GoogleWorkspace -ClientID "your-client-id" -ClientSecret "your-secret-key"

Step 3: Reset a user’s password

Set a new password for a specific user. The script below updates the password for user@example.com.

Set-GoogleWorkspaceUserPassword -User "user@example.com" -NewPassword "NewSecurePassword!"

Step 4: Notify the user

Send an email notification about the password change to ensure users are informed about the change.

Send-MailMessage -To "user@example.com" -From "admin@yourdomain.com" -Subject "Password Reset" -Body "Your password has been reset. Please change it upon login."

FAQs

1. How can I reset a Google Workspace user’s password?

Use Google’s API with PowerShell to reset a Google Workspace user’s password.

Set-GoogleUserPassword -User user@domain.com -NewPassword "NewPass@123"

2. Can I force users to change passwords at the next login?

Yes, you can force users to change passwords at the next login by modifying user settings in Google Admin Console.

3. Can I bulk reset passwords for multiple users?

Yes, you can bulk reset passwords for multiple users with Google API scripting.

 
  • Step 1: Install the Google Admin SDK module
  • Step 2: Authenticate to Google Admin API
  • Step 3: Reset a user’s password
  • Step 4: Notify the user
  • FAQs

ADSelfService Plus trusted by

A single pane of glass for complete self service password management
Email Download Link