diff options
author | Michael Adam <obnox@samba.org> | 2007-07-05 00:07:40 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:23:47 -0500 |
commit | 459d01489fcebfe923328409d8ad5750c218cb18 (patch) | |
tree | 679fca8c9d9c794d4d52aec31ebb9fbf5e06ea3c /examples/scripts | |
parent | 4b1fbd17c4de11e9da610e3ecd83a975a8e64df2 (diff) | |
download | samba-459d01489fcebfe923328409d8ad5750c218cb18.tar.gz |
r23712: This script allows for adding lists of users (or other objects)
to lists of groups (or aliases). Useful for creating large test
scenarios.
Michael
(This used to be commit 0c03c78af8f62ece2965e0f5a16c001aad61c8fa)
Diffstat (limited to 'examples/scripts')
-rwxr-xr-x | examples/scripts/users_and_groups/addusertogroups.pl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/scripts/users_and_groups/addusertogroups.pl b/examples/scripts/users_and_groups/addusertogroups.pl new file mode 100755 index 00000000000..f3e1bee9772 --- /dev/null +++ b/examples/scripts/users_and_groups/addusertogroups.pl @@ -0,0 +1,17 @@ +#!/usr/bin/perl + +use strict; + +my $dc = "192.168.45.44"; +my $adminuser = "administrator"; +my $adminpw = "geheim"; +my $maxgroups = 5000; +my $startgroup = 0; +my $rpccli_cmd = "/usr/bin/rpcclient"; +my $testuser = "testgroups"; + +for (my $num = $startgroup; $num <= $maxgroups; ++$num) { + my $group = sprintf "%s%.05d", "group", $num; + print "adding user $testuser to group $group\n"; + system("net rpc -I $dc -U$adminuser\%$adminpw group addmem $group $testuser"); +} |