Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (28 sloc) 878 Bytes
# Some useful functions related to Google Apps
# Requires Google Apps Manager and related Python/gdata framework
########################################
# A simple function to reset passwords #
########################################
function pwreset {
echo "Enter new password for user account $1"
read gpass
gam update user $1 password $gpass
echo "Password for $1 reset to $gpass"
gam update user $1 changepassword on
echo "$1 will be required to change password on next login"
}
################################################
# A simple function to search users or aliases #
################################################
function gfind {
echo "Enter whether this is a user/alias, and a search term."
read gval gtrm
if [ "$gval" = "user" ]
then
gam print users | egrep "$gtrm"
fi
if [ "$gval" = "alias" ]
then
gam print nicknames | egrep "$gtrm"
fi
}