Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Creating a script for adding samba/ldap users

Posted on 2009-05-20
4
Medium Priority
?
704 Views
Last Modified: 2013-12-02
I need to have a script to use for adding users to my samba PDC, which is integrated with ldap.

this script i have added is not working becouse it doesnt add a password, i need a command that adds a password too, so i can add several users from a text file.

Or else i cant get this users to log in to the domain, please help!
#!/bin/sh
 
 
IFS="
"
 
for line in `cat $1`;do
 
username=$line
 
smbldap-useradd -m $username
 
done

Open in new window

0
Comment
Question by:leeds2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 24430029
Hi,

do you know these?
- quoting -
There are two scripts in the smbldap-installer directory to help you add users in bulk: create-usernames and smbldap-useradd-bulk.
Here is a neat description -
https://wiki.ubuntu.com/SmbLdapManagingUsers#3
HTH
Cheers
wmp
 
 
0
 
LVL 3

Author Comment

by:leeds2000
ID: 24430077
I really need my script to be able to autogenerate the password, not a predefined bulk script
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 24430187
Since neither smbldap-useradd nor smbldap-usermod provide such a functionality, I'd really advise you to re-read the link I posted.
0
 
LVL 3

Accepted Solution

by:
leeds2000 earned 0 total points
ID: 24430195
ive figured out a easy way to do it, thanks for the help anyway.
#!/bin/sh
 
 
IFS="
"
 
for line in `cat $1`;do
 
username=$line
 
echo $username > passord.txt
echo $username >> passord.txt
smbldap-useradd -a -m $username
 
smbldap-passwd $username < passord.txt
 
rm passord.txt

Open in new window

0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem: Windows 32bit running out of paging space. Solution: Add additional page files on separate partitions. Background: By default Windows creates only one page file on the partition you install Windows on. You may know that the maximu…
Samba is the de-facto standard program (or, more correctly: suite of programs) that UNIX and Linux systems use to share files with Microsoft Windows (and more recently, Mac OS-X) systems. Currently, there are 2 common versions of Samba available,…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question