PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 07/18/2017 3:06 PM by  Roger French
Command to execute usergrpdef to add user
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Roger French
Private
Private
Veteran Member
(1266 points)
Veteran Member
Posts:522


Send Message:

--
07/18/2017 1:11 PM

    Has anyone have a LID command to automatically add a new user to a user group, using usergrpdef. I have the user, group (existing), but I want to run it in a command, and not have to run usergrpdef manually and the subscreens to add the user to the group, etc.

    Thanks in advance.

    Edited: 

    This is V10 so LAUA is not possible. 

    Also I am trying to avoid manually populating the required GEN Tables.

     

     

    Kwane McNeal
    Private
    Private
    Veteran Member
    (1197 points)
    Veteran Member
    Posts:399


    Send Message:

    --
    07/18/2017 1:21 PM
    Two ways I know of:
    1) Pass a keystroke stream to usergrpdef
    2) load the data directly into GEN
    ...I have never done it using method #1, but I have done something similar with laua, and know it's possible.

    Unless you have some odd requirement for using usergrpdef, I'd use method #2
    Leonard Courchaine
    Private
    Private
    Veteran Member
    (128 points)
    Veteran Member
    Posts:50


    Send Message:

    --
    07/18/2017 1:30 PM
    Hi, I've done it using method #2 described above. Here's the shell script code that I use that does even more than you're asking:
    echo "Adding Lawson environment data..."
    # Next, we'll add usergrpdef needed values
    sqlplus -s gen/$mGen < set echo off
    set feedback off
    UPDATE gen.userinfo
    set usergrp='LSFALL', jobqgrp='LSFALL'
    where username='$mAIXID';
    UPDATE gen.r_user
    set printergroup='LSFALL'
    where username='$mAIXID';
    INSERT INTO gen.usergrpdtl
    (USERGRP, USERNAME, R_TYPE)
    VALUES
    ('LSFALL','$mAIXID','55');
    exit
    EOF11

    (you can see that I'm using variables for the gen pword along with the user)
    Let me know if you have questions.
    Kwane McNeal
    Private
    Private
    Veteran Member
    (1197 points)
    Veteran Member
    Posts:399


    Send Message:

    --
    07/18/2017 1:36 PM
    Another would be to write temp files, and use importdb.
    This is the tool I use if it's in a script.

    Leonard's script also looks good, just remember to update the literal values.
    Roger French
    Private
    Private
    Veteran Member
    (1266 points)
    Veteran Member
    Posts:522


    Send Message:

    --
    07/18/2017 3:06 PM

    But the thing with the SQL INSERT, for new records (adding a new record) into R_USER, because the columns are all NOT_NULL type (SQL DB, LSFV10.0.9), you have to have all the values in R_USER populated using SQL INSERT. I don't want to populate all of the columns in R_USER because for this install, the values aren't needed.

    I'll just use importdb instead. 

     

     

    You are not authorized to post a reply.