summaryrefslogtreecommitdiff
path: root/examples/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'examples/scripts')
-rwxr-xr-xexamples/scripts/users_and_groups/addusertogroups.pl17
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 0000000000..f3e1bee977
--- /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");
+}