Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: Catton on October 18, 2011, 12:07:31 AM
-
I would like modify an existing user via a script. Ie . add a user to a group and remove a user from a group.
I believe the proper way would be signal-event user-modify ‘username’ …. but I am not sure the proper syntax and could not find an example of such.
I would run this in a cron job.
Any help would be greatly appreciated
-
Catton
I'm sure if you search these forums you would find numerous examples.
Here is a sure fire way to find out any command that sme server uses.
Make whatever change in server manager eg change/modify/add a user.
Then review the messages log file most recent entries and you will see all the commands & syntax that were issued to enact that change.
Copy the command and syntax and signal event to suit your specific requirement.
-
Thanks Mary
I handnt thought of using messages that way. I also tried it with lazy admin tools 'lat-groups'. In both cases it the log showed the db OLD NEW followed by event: group-modify. My Lazy-Admin solution was
lat-groups -r -f -c " zgroup | zztest "
lat-groups -a -c "zgroup | testgrp | | zztest"
lat worked easy to remove
lat-groups -r -f -c " group | user "
But to add the user back to the group lat required the | Description |
lat-groups -a -c "group | description | | user"
Oct 20 17:33:41 smfserver02 /usr/sbin/lat-groups[17688]: /home/e-smith/db/accounts: OLD zgroup=group|Description|testgrp|Gid|5469|Members|zztest|Uid|5469
Oct 20 17:33:41 smfserver02 /usr/sbin/lat-groups[17688]: /home/e-smith/db/accounts: NEW zgroup=group|Description|testgrp|Gid|5469|Members||Uid|5469
Oct 20 17:33:41 smfserver02 esmith::event[17689]: Processing event: group-modify zgroup