r23712: This script allows for adding lists of users (or other objects)
[ira/wip.git] / examples / scripts / users_and_groups / addusertogroups.pl
1 #!/usr/bin/perl
2
3 use strict;
4
5 my $dc          = "192.168.45.44";
6 my $adminuser   = "administrator";
7 my $adminpw     = "geheim";
8 my $maxgroups   = 5000;
9 my $startgroup  = 0;
10 my $rpccli_cmd  = "/usr/bin/rpcclient";
11 my $testuser    = "testgroups";
12
13 for (my $num = $startgroup; $num <= $maxgroups; ++$num) {
14         my $group = sprintf "%s%.05d", "group", $num;
15         print "adding user $testuser to group $group\n";
16         system("net rpc -I $dc -U$adminuser\%$adminpw group addmem $group $testuser");
17 }