Jump to content


Import users from CSV

perforce users

  • Please log in to reply
9 replies to this topic

#1 sammex

sammex

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 05 May 2017 - 12:38 PM

I read in this documentation post that you should be able to import chunks of users from a CSV file but I can't find it in the p4admin or anywhere. Where can I find this option?

https://www.perforce.../DB5-49628.html

We're using the latest version from the ubuntu repo of the server and latest client from the site.

Thanks!

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 979 posts

Posted 08 May 2017 - 03:37 PM

The doc you linked is for Commons -- are you using that?  (I think Commons has been deprecated -- the last release was in 2014 and I can't even find an option to download it on the website now.)

#3 sammex

sammex

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 09 May 2017 - 07:27 AM

Yeah I can't find it either. If Commons can't be used anymore, is there any other way to import a bunch of users into Perforce?

Thanks

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 979 posts

Posted 09 May 2017 - 09:28 AM

In its default configuration, Perforce just auto-creates users when they connect, so there's no need to do any special importing.  If you have more specialized requirements (like you want each user to be created with a generated password, or you need to put them all into a group, or...) it shouldn't be hard to script, but I'd need to know more about the requirements in order to be able to give you pointers there.

#5 sammex

sammex

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 12 May 2017 - 08:35 AM

Basically what I need to do is to create users through a script. I looked at the python module but didn't really understand how to create new users and set all the information (password, name, email). The best would be to do it either in bash or python so I can use postfix to email the users the login in password. Can I do a p4 user command to create a new user and add all the information?

#6 Mailman Sync

Mailman Sync

    Advanced Member

  • Maillist Aggregator
  • 2495 posts

Posted 12 May 2017 - 10:50 AM

Originally posted to the perforce-user mailing list by: Michael Mirman


> Can I do a p4 user command to create a new user and add all the information?

You need two commands:
"p4 user" will create a user, and then you have to run "p4 passwd" for that user to create the password.

You can run something simple like
(echo foo12345; echo foo12345) | p4 passwd <some-userid>

If your default authentication method is ldap (not perforce), then you don’t have to run "p4 passwd" for new users as long as the users are in AD.

--
Michael Mirman
MathWorks, Inc.
508-647-7555

-----Original Message-----
From: perforce-user [mailto:perforce-user-bounces@perforce.com] On Behalf Of sammex
Sent: Friday, May 12, 2017 4:40 AM
To: perforce-user@perforce.com
Subject: Re: [p4] Import users from CSV

Posted on behalf of forum user 'sammex'.

Basically what I need to do is to create users through a script. I looked at the
python module but didn't really understand how to create new users and set
all the information (password, name, email). The best would be to do it either
in bash or python so I can use postfix to email the users the login in password.
Can I do a p4 user command to create a new user and add all the information?



--
Please click here to see the post in its original format:
  http://forums.perfor...-users-from-csv
_______________________________________________
perforce-user mailing list  -  perforce-user@perforce.com
http://maillist.perf...o/perforce-user
_______________________________________________
perforce-user mailing list  -  perforce-user@perforce.com
http://maillist.perf...o/perforce-user


#7 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 979 posts

Posted 12 May 2017 - 02:55 PM

Once upon a time you could set the password right in the user form -- I'm not sure if that's still allowed with security=0 or if it's completely disabled now, but if that still works you can make a new user via:

p4 --field User=USERNAME --field Email=EMAIL --field Password=PASSWORD user -o | p4 user -if

Otherwise, leave off the Password part and use a separate "p4 passwd" command like Michael said.

#8 Mailman Sync

Mailman Sync

    Advanced Member

  • Maillist Aggregator
  • 2495 posts

Posted 12 May 2017 - 03:40 PM

Originally posted to the perforce-user mailing list by: Michael Mirman


Quote

not sure if that's still allowed with security=0
It is allowed. Just tested. :-)

For security=3, you get a nice message
Passwords can only be set by 'p4 passwd' at this security level.

I think this falls under one of the security levels, which disallows cleartext passwords. I don’t remember which level that is though.

--
Michael Mirman
MathWorks, Inc.
3 Apple Hill Drive, Natick, MA 01760
508-647-7555

Quote

-----Original Message-----
From: perforce-user [mailto:perforce-user-bounces@perforce.com] On
Behalf Of Sambwise
Sent: Friday, May 12, 2017 11:00 AM
To: perforce-user@perforce.com
Subject: Re: [p4] Import users from CSV

Posted on behalf of forum user 'Sambwise'.

Once upon a time you could set the password right in the user form -- I'm
not sure if that's still allowed with security=0 or if it's completely
disabled now, but if that still works you can make a new user via:

p4 --field User=USERNAME --field Email=EMAIL --field Password=PASSWORD
| p4 user -if
Otherwise, leave off the Password part and use a separate "p4 passwd"
command like Michael said.



--
Please click here to see the post in its original format:
  http://forums.perfor...-users-from-csv
_______________________________________________
perforce-user mailing list  -  perforce-user@perforce.com
http://maillist.perf...o/perforce-user
_______________________________________________
perforce-user mailing list  -  perforce-user@perforce.com
http://maillist.perf...o/perforce-user



#9 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 979 posts

Posted 12 May 2017 - 04:09 PM

View PostMailman Sync, on 12 May 2017 - 03:40 PM, said:

It is allowed. Just tested. :-)

For security=3, you get a nice message
Passwords can only be set by 'p4 passwd' at this security level.

I think this falls under one of the security levels, which disallows cleartext passwords. I don’t remember which level that is though.

I think you have to go all the way to 3 to completely block cleartext passwords and require strong passwords (forcing client upgrades if necessary).  I'm pretty sure setting the password in the user form sends it across the network in the clear since it's not going through the "p4 passwd" crypto exchange (can test this by running "p4 -vnet=5 user" or something like that) -- not a big deal if you're on a secure connection or running it locally, of course.

#10 Matt Janulewicz

Matt Janulewicz

    Advanced Member

  • Members
  • PipPipPip
  • 199 posts
  • LocationSan Francisco, CA

Posted 15 May 2017 - 04:57 PM

View PostMailman Sync, on 12 May 2017 - 10:50 AM, said:

Originally posted to the perforce-user mailing list by: Michael Mirman

If your default authentication method is ldap (not perforce), then you don’t have to run "p4 passwd" for new users as long as the users are in AD.



If you set up LDAP right you don't even have to run 'p4 user', either. :)
-Matt Janulewicz
Staff SCM Engineer, Perforce Administrator
Dolby Laboratories, Inc.
1275 Market St.
San Francisco, CA 94103, USA
majanu@dolby.com





Also tagged with one or more of these keywords: perforce, users

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users