[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Get email addresses for all users
- Subject: Re: [cobalt-users] Get email addresses for all users
- From: "Matthew John Darnell" <mdarnell@xxxxxxxxxxx>
- Date: Thu Jun 26 19:39:06 2003
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
> On the RaQ550 mail spools are stored in the users home dir.
> Here is a little script to do what you want, you can also grab it from:
> ftp://ftp-eng.cobalt.com/pub/users/jeffb/scripts/getUsersRaQ550.pl
>
> Jeff-
>
> #!/usr/bin/perl
> # list all the email addresses for users, it will give the fqdn of the
user
> # skip root level users
>
> use lib "/usr/sausalito/perl";
> use strict;
> use CCE;
> my $cce = new CCE;
> $cce->connectuds();
>
> my @oids = $cce->find('User');
> my ($ok, $obj, $out);
> foreach my $oid (@oids) {
> ($ok, $obj) = $cce->get($oid);
> if(!$obj->{site}) { next; }
> $out .= $obj->{name};
> ($oid) = $cce->find('Vsite', { 'name' => $obj->{site} });
> ($ok, $obj) = $cce->get($oid);
> $out .= '@'.$obj->{fqdn}.',';
> }
> print $out, "\n";
> $cce->bye("Ticking away the moments that make up a dull day");
> exit 0;
Worked like a charm! Did you whip it up or was it already written?
Saved me a LOT of time.
Aloha,
Matt