Ok, I used the example script and trimmed it down so that I'm only using
what I need and this is the output....


version      = 6.0
build        = 6249.4
service pack = 3
Failed creating CDO.Person object
 - Error returning into main from new ()



Here is the script below...


#!/usr/local/bin/perl
use Win32::Exchange;

$domain = Win32::DomainName();
$info_store_server="delta";
$mta_server=$info_store_server; # this could be different, but for
testing, we'll set them the same
$storage_group = ""; # you'd need to define this if you had more than 1
storage group on 1 server.
$mailbox_store = ""; # you'd need to define this if you had more than 1
mailbox store on 1 or more storage groups.

$mailbox_alias_name='hjablome';
$givenName = "Heywood";
$sn = "Jablome";
$mailbox_full_name="$givenName $mailbox_alias_name $sn";
#$distribution_list="Users"; # group / DL the user will be added to.
$email_domain = "foo.com";
#$trustee_group = "Domain Admins"; # the group that has permission to log
into this mailbox as well as the recipient

if (!Win32::Exchange::GetVersion($info_store_server,\%ver) ) {
  print "$rtn - Error returning into main from GetVersion\n";
  exit 0;
}

print "version      = $ver{ver}\n";
print "build        = $ver{build}\n";
print "service pack = $ver{sp}\n";
if (!($provider = Win32::Exchange::Mailbox->new($info_store_server))) {
  print "$rtn - Error returning into main from new
($Win32::Exchange::VERSION)\n";
  exit 0;
}

e60();


sub e60 {

  if
(Win32::Exchange::LocateMailboxStore($info_store_server,$storage_group,$mailbox_store,$store_name,[EMAIL
 PROTECTED]))
{
    print "storage group = $storage_group\n";
    print "mailbox store = $mailbox_store\n";
    print "located store distinguished name= $store_name\n";
    print "$info_store_server\n";
    print "  Total:\n";
    print "    storage groups = $counts[0]\n";
    print "    mailbox stores = $counts[1]\n";
  }
  if ($mailbox = $provider->GetMailbox($mailbox_alias_name)) {
    print "Got Mailbox successfully\n";
  } else {
    print "Mailbox did not exist\n";
    if ($mailbox = $provider->CreateMailbox($mailbox_alias_name
                                           )
       ) {
      print "Mailbox create succeeded.\n";
    } else {
      print "Mailbox creation failed.\n";
      exit 0;
    }

  }
}


Thanks for the help,
Chris P.




> The embedded HTML example might be a little off -- not sure when I last
> updated it.  But now see that I should be updating it a little more
> often.
>
> Instead, please use the exchange_example.pl located in the
> perl\site\lib\win32 directory.
>
> Sorry for any confusion.
>
> Steven
>



_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to