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"); +}