summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-12-03 05:24:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:18 -0500
commitcef92d7fd5f5bff8e59d286058bc035cb54166b6 (patch)
tree276efaef8faea82b76a37caeb3c2d0ce48ad404c
parent300cebcc9d8a2db208b1bcc5ebfaec13b883e356 (diff)
downloadsamba-cef92d7fd5f5bff8e59d286058bc035cb54166b6.tar.gz
samba-cef92d7fd5f5bff8e59d286058bc035cb54166b6.tar.bz2
samba-cef92d7fd5f5bff8e59d286058bc035cb54166b6.zip
r4050: make sure we add objectClass and sAMAccountName
(This used to be commit 57d0079bb91b8edc625027e1f28203794e018afc)
-rwxr-xr-xsource4/script/newuser.pl13
1 files changed, 6 insertions, 7 deletions
diff --git a/source4/script/newuser.pl b/source4/script/newuser.pl
index 7930b24e37..22e3992bbe 100755
--- a/source4/script/newuser.pl
+++ b/source4/script/newuser.pl
@@ -99,8 +99,6 @@ my $domain_dn = search("(objectClass=domainDNS)", "dn");
my $ldif = `ldbsearch 'cn=TemplateUser' | grep -v Template | grep -v '^#'`;
chomp $ldif;
-$ldif .= "name: $opt_username\n";
-
my $sid;
# crude way of working out a rid
@@ -113,16 +111,17 @@ for (my $i=1001;$i<1100;$i++) {
print "Chose new SID $sid\n";
-$ldif .= "objectSid: $sid\n";
-
-$ldif .= "objectGUID: " . randguid() . "\n";
-
my $dom_users = search("name=Domain Users", "dn");
-$ldif .= "memberOf: $dom_users\n";
+$ldif .= "sAMAccountName: $opt_username\n";
+$ldif .= "name: $opt_username\n";
+$ldif .= "objectSid: $sid\n";
+$ldif .= "objectGUID: " . randguid() . "\n";
+$ldif .= "memberOf: $dom_users\n";
$ldif .= "userAccountControl: 0x10200\n";
$ldif .= "sAMAccountType: 0x30000000\n";
+$ldif .= "objectClass: user\n";
$ldif .= "unicodePwd: $opt_password\n";
$ldif .= "unixName: $opt_unixname\n";