Koozali.org: home of the SME Server

How to create account or import account by scripts?

cityexplorer

How to create account or import account by scripts?
« on: October 18, 2006, 01:35:12 PM »
Any one know how to create account by script?

I have 300+ users information in delimited text and want to create account on SME r7.0.

Tried the lazy admin tookit but it gave errors.. I think it works with v6 only...

Please help. Thanks.

Offline byte

  • *
  • 2,183
  • +2/-0
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

cityexplorer

How to create account or import account by scripts?
« Reply #2 on: October 19, 2006, 04:46:23 AM »
Just tried... it works for most cases..

Except it will gives errors when the login name is longer than 12 characters (v7 support up to 31 characters i guess), and it won't works with group name with "."

Thanks.

Quote from: "byte"
This is for SME 7.x

http://mirror.contribs.org/smeserver//contribs/jbennett/sme7/lat/

Offline raem

  • *
  • 3,972
  • +4/-0
How to create account or import account by scripts?
« Reply #3 on: October 19, 2006, 11:12:14 AM »
cityexplorer

> it will gives errors when the login name is longer than 12 characters
> (v7 support up to 31 characters i guess)

These will show you lot's of settings

config show

config show |more

These will show you the specific settings you are interested in

config show maxAcctNameLength

config show maxGroupNameLength

config show maxIbayNameLength

for usage to set a different length do
db
...

cityexplorer

How to create account or import account by scripts?
« Reply #4 on: October 19, 2006, 01:46:21 PM »
I think the problem is lazy toolkit doesn't support the new longer login name, group name with "." characher and alias with full domain name.

I don't want to change the default setting of SME v7...

Offline jonic

  • *
  • 103
  • +1/-0
How to create account or import account by scripts?
« Reply #5 on: October 20, 2006, 06:52:19 PM »
I can confirm that, lazy admin and user names longer than 12 letters, didn't work for me either.

Offline byte

  • *
  • 2,183
  • +2/-0
How to create account or import account by scripts?
« Reply #6 on: October 20, 2006, 07:27:20 PM »
Quote from: "jonic"
I can confirm that, lazy admin and user names longer than 12 letters, didn't work for me either.


But did you change the SME Server settings to allow  > 12 as per Ray's post?
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline jonic

  • *
  • 103
  • +1/-0
How to create account or import account by scripts?
« Reply #7 on: October 20, 2006, 07:42:54 PM »
Quote
But did you change the SME Server settings to allow > 12 as per Ray's post?


No, I didn't, I assumed that since I was able to add usernames longer than 12 letters through server-manager, it would work with lazy admin too (without any additional db settings), but it appears I was wrong.

Offline byte

  • *
  • 2,183
  • +2/-0
How to create account or import account by scripts?
« Reply #8 on: October 20, 2006, 08:06:33 PM »
Quote from: "jonic"

No, I didn't, I assumed that since I was able to add usernames longer than 12 letters through server-manager,


Ok thats becasue the default allowed is 31 letters

Quote

it would work with lazy admin too (without any additional db settings), but it appears I was wrong.


If it doesn't work as you say with the lazy admin tool then please raise a bug against the contrib.
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
How to create account or import account by scripts?
« Reply #9 on: October 20, 2006, 09:32:03 PM »
Quote from: "byte"


If it doesn't work as you say with the lazy admin tool then please raise a bug against the contrib.


No, please don't do that, download the SRPM and make the appropriate changes.  I do not plan on maintaining this RPM.  I contacted the original author of this package to see if he was going to update it for SME 7, but never received an answer, so I changed it so that it would work with SME 7.  It needs some work as it's still using the old API calls as well.

John Bennett
......

Offline jonic

  • *
  • 103
  • +1/-0
How to create account or import account by scripts?
« Reply #10 on: October 21, 2006, 12:09:41 AM »
Quote
No, please don't do that, download the SRPM and make the appropriate changes.


I would be glad to do this, but I am still new to SME Server, and the whole template & database settings thing. Maybe after I go through the developers guide and get more experience with it.

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
How to create account or import account by scripts?
« Reply #11 on: October 21, 2006, 03:55:13 AM »
Quote from: "jonic"
I would be glad to do this, but I am still new to SME Server, and the whole template & database settings thing. Maybe after I go through the developers guide and get more experience with it.


Great, you will learn a lot of the SME Server structure if you download and install the SRPM.  In the developer's guide it recommends to use mezzanine, which IMO, makes creating and updating an rpm much easier.  Good luck and I will help as much as I can.

John Bennett
......

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
How to create account or import account by scripts?
« Reply #12 on: October 22, 2006, 04:47:07 PM »
I know I said I don't want to maintain this rpm, which I still don't, but I believe I have corrected the error.  I was able to create a user with 31 characters, and got an error when I tried to create one with 32 characters.

It will be here http://mirror.contribs.org/smeserver/contribs//jbennett/sme7/lat/ once the mirrors sync.

smeserver-lazy_admin_tools-0.9.1-2.noarch.rpm

John Bennett
......

Offline jonic

  • *
  • 103
  • +1/-0
How to create account or import account by scripts?
« Reply #13 on: October 22, 2006, 10:10:57 PM »
Thank you, it would've taken me a long time to correct the problem. I still got a lot to learn about SME, and linux in general.