Script to create user with specific FID for GroupWise 2014

Script to create user with specific FID for GroupWise 2014

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 (1)

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
5 of 5
Last update:
‎2020-02-21 17:39
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.