In AD can you right click the tree of the users you want to export>csv file.
(the below is shortened from this:
Bulk Provisioning - ZimbraWiki )
-remove extraneous columns
The following is a simple perl script to take a CSV file and turn it into the correct zmprov commands-obviously change the variables to the actual fields you use in your CSV file.
#!/usr/bin/perl
while (<>) {
chomp;
my ($email, $password, $first, $last) = split(/\,/, $_, 4);
print qq{ca $email $password\n};
print qq{ma $email givenName "$first"\n};
print qq{ma $email sn "$last"\n};
print qq{ma $email displayName "$first $last"\n};
print qq{\n};
}
I would use ‘’ for the passwords so that it would use the external auth. (Seeing as passwords probably won't be in this csv list & you said earlier that your
auth is working properly.)
This would assign everyone to the default COS (class of service), if you wanted to organize it during import, put the cos names in the csv file, then lookup the valid COS ID ahead of time or like this:
my $cosid = `su - zimbra -c 'zmprov gc Default |grep zimbraId:'`;
$cosid =~ s/zimbraId:\s*|\s*$//g;
Then add:
print qq{ma $email zimbraCOSid "$cosid"\n};