|
I found this Stack Overflow post in which it is asked to force the Google Apps Users to change the password periodically. I quickly created an script which will allow Google Apps admin to force the users to Change the password.
Open this link to make a copy of the script file and follow the instructions given in below screenshot. Step 2 shows the frequencywhich can be changed as per your organization requirement.
Note : Script can be run only under Google Apps Admin's authority
![]()
Google Apps Script
function invalidatePass() {//Create logsLogger.log('Execution started');Logger.log('Following users forced to change password on next login');Logger.log('--------------------------------------------------------');var mailSent = false;try {//get all users in domainvar users = UserManager.getAllUsers();//iterate for each userfor(var i in users){//set the user to change password on next loginusers[i].setChangePasswordAtNextLogin(true);//Put the email of the user in logLogger.log(users[i].getEmail())}}//Catch if any error occurscatch(e){//Log the errorLogger.log('--------------------------------------------------------');Logger.log('Error occured: '+e.message);//Send an email to yourself with logsGmailApp.sendEmail(Session.getEffectiveUser().getEmail(), 'Log for User Pass Change Script : Error occured', Logger.getLog());mailSent = true;}if(!mailSent){//if execution successfulLogger.log('--------------------------------------------------------');Logger.log('Execution ended. Script completed successfully');//Send an email to yourself with logsGmailApp.sendEmail(Session.getEffectiveUser().getEmail(), 'Log for User Pass Change Script: Successful', Logger.getLog());}}
|
Home >

