Author Topic: Adding a new user to a usergroup using ARSXML  (Read 3993 times)

kit

  • Guest
Adding a new user to a usergroup using ARSXML
« on: June 30, 2015, 07:50:49 AM »
Hello experts,

Just wondering if there a way we can add a new user to an existing usergroup in CMOD using ARSXML utility. I have tried the command below using the following sample input xml file but failed due to the group object name was exist.

           E:\Apps\IBM\OnDemand for Windows\V9.0\bin>arsxml add -h localhost -u userid -p password -i newuser1.xml
           ARS6822I Attempting login for userid 'yaht' on server 'localhost' ...
           ARS1609W Specifying passwords on the command line is insecure due to the text being visible. See the Installation and Configuration 
              Guide for your platform for information about the arsstash command or using Unified Login.
           ARS7743E A group object named 'APPS_ARMS_DEVL_SYSADMIN' already exists.
-----------------------------------------------
NEWUSER1.XML
-----------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<onDemand xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="E:\Apps\IBM\OnDemand for Windows\V9.0\xml\ondemand.xsd">

<user name="Bill" newName="Bill" password="password" description="ARMS System Admin" userType="User Admin"/>
<group name="APPS_ARMS_DEVL_SYSADMIN"/>

</onDemand>
------------------------------------------------

I appreciate your help.

Thanks,

Kit


Greg Ira

  • Full Member
  • ***
  • Posts: 240
    • View Profile
Re: Adding a new user to a usergroup using ARSXML
« Reply #1 on: June 30, 2015, 07:52:41 AM »
Did you try ARSXML update instead of add?

kit

  • Guest
Re: Adding a new user to a usergroup using ARSXML
« Reply #2 on: June 30, 2015, 10:46:34 AM »
I have tried using the update but it failed because it couldn't find the user since it's new user that i'm trying to add.

Greg Ira

  • Full Member
  • ***
  • Posts: 240
    • View Profile
Re: Adding a new user to a usergroup using ARSXML
« Reply #3 on: June 30, 2015, 01:16:00 PM »
So it sounds like you'll need to do it in two steps.  ARSXML add the user then ARSXML update the group with the user.

Frederick Tybalt

  • Full Member
  • ***
  • Posts: 124
    • View Profile
    • Personal Website
Re: Adding a new user to a usergroup using ARSXML
« Reply #4 on: July 01, 2015, 02:36:06 AM »
Try add command and use error handling to update if already exists.
rIcK
======------------------======
www.rick.co.in | www.tekbytz.com

Ed_Arnold

  • Hero Member
  • *****
  • Posts: 1199
    • View Profile
Re: Adding a new user to a usergroup using ARSXML
« Reply #5 on: July 01, 2015, 07:48:22 AM »
Note that there are sample files addusers.xml and addusers.ebcdic.xml on my system anyway in /usr/lpp/ars/V8R5M0/bin/xml/samples/

Ed
#zOS #ODF

kit

  • Guest
Re: Adding a new user to a usergroup using ARSXML
« Reply #6 on: July 03, 2015, 10:25:12 AM »
Thanks a lot for all your help guys. I got it working now.
I used error handling(-e u) option and modify my xml input file. Please see below.

------COMMAND----------------------
arsxml add -h localhost -u <userid> -p <passw> -i NEWUSER1.XML -e u
---------------------------------------

----NEWUSER1.XML-------------------
<?xml version="1.0" encoding="UTF-8"?>
<onDemand xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="E:\Apps\IBM\OnDemand for Windows\V9.0\xml\ondemand.xsd">

<user name="Bill" newName="Bill" password="password" description="ARMS System Admin" userType="System Admin"/>
<group name="APPS_ARMS_DEVL_SYSADMIN">
   <user task="add" name="Bill"/>
</group>
</onDemand>
-----------------------------------------