[BlueOnyx:22673] Re: exporting all users to CSV
Michael Aronoff
maronoff at gmail.com
Thu Feb 7 04:53:39 -05 2019
Janwillem wrote:
> If I remember well it was possible in the past in 5106R to export all users to CSV
I have a perl script that would export a list of all usernames on the server. If I remember I still had to edit the file a tiny bit but it did a good job. I have not tried this in a while but it did work on my 5208 the last time I tried it.
Here is the script.
#!/usr/bin/perl -I/usr/sausalito/perl
# Author: Brian N. Smith
# Copyright 2008, NuOnce Networks, Inc. All rights reserved.
# $Id: get_user_email.pl v1.0 2008/01/28 23:18:00 Exp $
# use command below to run and output to file.
# ./get_user_email.txt > maillist.txt
use CCE;
my $cce = new CCE;
$cce->connectuds();
@all_virtual_sites = $cce->find("Vsite");
foreach $vsite_oid(@all_virtual_sites) {
my ($ok, $vsite) = $cce->get($vsite_oid);
$fqdn = $vsite->{'fqdn'};
$fqdn =~ s/www.//g;
$fqdn =~ s/mail.//g;
@all_users = $cce->find("User", {'site' => $vsite->{'name'}});
foreach $user_oid(@all_users) {
my ($ok, $user) = $cce->get($user_oid);
$username = $user->{'name'};
print $username . "@" . $fqdn . "\n";
}
}
______________________________
M Aronoff Out – maronoff at gmail.com
I'm a great believer in luck, and I find the harder I work the more I have of it.
- Thomas Jefferson
More information about the Blueonyx
mailing list