Script to create user with specific FID for GroupWise 2014

0 Likes
over 6 years ago
This is a script to create a user with a specific FID for GroupWise 2014.

#/bin/bash

# -- Script to create GW user with a given FID --
# -- Edit IP PORT and GWADMIN values to match your system

IP=10.10.10.10
PORT=9710
GWADMIN=admin

read -p "Enter GroupWise Admin Password: " ADMINPWD

read -p "Enter GroupWise UserID for new user: " GWID
read -p "Enter First Name for $GWID: " FIRST
read -p "Enter Last Name for $GWID: " LAST
read -p "Enter FID for $GWID: " FID
read -p "Enter Domain for $GWID: " DOM
read -p "Enter Post Office for $GWID: " PO
read -p "Enter new password for $GWID: " USERPWD
BASEURL="https://$IP:$PORT/gwadmin-service/domains/$DOM/postoffices/$PO/users"
USERDATA='{"name":"'$GWID'","givenName":"'$FIRST'","surname":"'$LAST'","fileId":"'$FID'"}'
PWDDATA='{"userPassword":{"value":"'$USERPWD'"}}'
PWDURL="$BASEURL/$GWID/clientoptions"
curl -k --user $GWADMIN:$ADMINPWD -H "content-type:application/json" -X POST --data $USERDATA $BASEURL

curl -k --user $GWADMIN:$ADMINPWD -H "content-type:application/json" -X PUT --data $PWDDATA $PWDURL


This is a use at your own risk script.  Please make sure you have a complete, working backup of your GroupWise system before using this script.

Labels:

How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended