<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: create user accounts in batch? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/create-user-accounts-in-batch/m-p/4883773#M401034</link>
    <description>For each user, do the following:&lt;BR /&gt;&lt;BR /&gt;1) useradd (see above or man (1M)&lt;BR /&gt;&lt;BR /&gt;2) /usr/sam/lbin/usermod.sam -F -p "" account_name&lt;BR /&gt;&lt;BR /&gt;This will force the user to enter a new password when they log in the first time.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Kent M. Ostby&lt;BR /&gt;</description>
    <pubDate>Wed, 02 Feb 2005 16:44:39 GMT</pubDate>
    <dc:creator>Kent Ostby</dc:creator>
    <dc:date>2005-02-02T16:44:39Z</dc:date>
    <item>
      <title>create user accounts in batch?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-user-accounts-in-batch/m-p/4883770#M401031</link>
      <description>I need to set up 300 users and want to do this from a script. I can create the accounts with useradd, but I would like the password displayed so I can redirect and collect in an output file. Man page says useradd sends "random password" to stdout but it doesn't seem to. This is a trusted system.</description>
      <pubDate>Wed, 02 Feb 2005 14:55:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-user-accounts-in-batch/m-p/4883770#M401031</guid>
      <dc:creator>Joe Alexander_1</dc:creator>
      <dc:date>2005-02-02T14:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: create user accounts in batch?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-user-accounts-in-batch/m-p/4883771#M401032</link>
      <description>yes.&lt;BR /&gt;&lt;BR /&gt;Make a list of users, one per line.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sammy&lt;BR /&gt;schmo&lt;BR /&gt;bagel&lt;BR /&gt;&lt;BR /&gt;call it userlist&lt;BR /&gt;&lt;BR /&gt;script:&lt;BR /&gt;&lt;BR /&gt;while read -r username&lt;BR /&gt;do&lt;BR /&gt;    useradd $username&lt;BR /&gt;    passwd $username&lt;BR /&gt;    &amp;lt;&amp;lt; place code here to set password&amp;gt;&amp;gt; without input.&lt;BR /&gt;done &amp;lt; userlist&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You might wish to have a temporary password list.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 02 Feb 2005 15:01:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-user-accounts-in-batch/m-p/4883771#M401032</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-02-02T15:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: create user accounts in batch?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-user-accounts-in-batch/m-p/4883772#M401033</link>
      <description>I'd use expect for something like this.. Expect can take variables, and write files and would do exactly what you need.&lt;BR /&gt;&lt;BR /&gt;Just to get you started..&lt;BR /&gt;Depot:&lt;BR /&gt;&lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Tcl/expect-5.42/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Tcl/expect-5.42/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Small add user &amp;amp; change password script (untested):&lt;BR /&gt;#!/usr/local/bin/expect -f&lt;BR /&gt;set timeout -1&lt;BR /&gt;spawn $env(SHELL)&lt;BR /&gt;match_max 100000&lt;BR /&gt;expect -exact "# "&lt;BR /&gt;send -- "useradd username\r"&lt;BR /&gt;expect -exact "# "&lt;BR /&gt;send -- "passwd username\r"&lt;BR /&gt;expect -exact "Changing password for username"&lt;BR /&gt;New password: "&lt;BR /&gt;send -- "new\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;Re-enter new password: "&lt;BR /&gt;send -- "new\r"&lt;BR /&gt;expect -exact "\r&lt;BR /&gt;Passwd successfully changed\r&lt;BR /&gt;# "&lt;BR /&gt;expect eof&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Feb 2005 15:04:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-user-accounts-in-batch/m-p/4883772#M401033</guid>
      <dc:creator>MattJ123</dc:creator>
      <dc:date>2005-02-02T15:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: create user accounts in batch?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-user-accounts-in-batch/m-p/4883773#M401034</link>
      <description>For each user, do the following:&lt;BR /&gt;&lt;BR /&gt;1) useradd (see above or man (1M)&lt;BR /&gt;&lt;BR /&gt;2) /usr/sam/lbin/usermod.sam -F -p "" account_name&lt;BR /&gt;&lt;BR /&gt;This will force the user to enter a new password when they log in the first time.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Kent M. Ostby&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Feb 2005 16:44:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-user-accounts-in-batch/m-p/4883773#M401034</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2005-02-02T16:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: create user accounts in batch?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/create-user-accounts-in-batch/m-p/4883774#M401035</link>
      <description>Thanks for the variety of solutions. The solution I chose was to use useradd to create the account, then use the UNSUPPORTED /usr/lbin command modprpw -x to set a temporary password, which is echoed to stdout.</description>
      <pubDate>Thu, 03 Feb 2005 09:29:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/create-user-accounts-in-batch/m-p/4883774#M401035</guid>
      <dc:creator>Joe Alexander_1</dc:creator>
      <dc:date>2005-02-03T09:29:38Z</dc:date>
    </item>
  </channel>
</rss>

