MailEnable is a method in CDOEX, but it doesn't involve anything more
than AD.  Unlike a mailbox enable, you can simply update AD props and
end up with a mail enabled user.


-----Original Message-----
From: Steven Manross [mailto:[EMAIL PROTECTED]] 
Posted At: Wednesday, January 15, 2003 4:39 PM
Posted To: perl-win32-admin
Conversation: MailEnable with Perl on win32?
Subject: RE: MailEnable with Perl on win32?

I'd need to know if we're talking about Exchange 5.5 or 2K (because I'm
not
sure if you can MailEnable an E55 mailbox), but in E2K...

I disagree.

MailEnable is an Exchange Method on an AD user account.  In addition to
populating the address that you need to send mail to instead of an
Exchange
account, you need to MailEnable the account.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss
/_cd
o_imailrecipient_mailenable.asp

As for Perl or VB..  It's not an issue..  You now have code for both
(the
above link and the code below).

The following code should MailEnable an account to the address specified
while while I suggest adding your own error-checking after each line.

use Win32::OLE;

$this_address = '[EMAIL PROTECTED]';
$provider = Win32::OLE->new("CDO.Person");
$provider->Datasource->Open("LDAP://server/cn=Users,dc=whatever,dc=com";,
unde
f,3);
$interface = $provider->GetInterface("IMailRecipient");
$interface->MailEnable($this_address);
$provider->Datasource->Save();

<shameless_plug>
Win32-Exchange is available in PPM form from
http://www.roth.net/perl/packages and CPAN.

A MailEnable method/function should be available soon in Build 033 or
034.
</shameless_plug> 

Steven

-----Original Message-----
From: Rick Tatem [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 15, 2003 2:59 PM
To: [EMAIL PROTECTED]
Subject: RE: MailEnable with Perl on win32?


Once the mailbox is deleted (i.e. the Active Directory account is
disassociated from the Information Store object), then "mailenabled" is
just
a function of the Active Directory, not Exchange.  To be mail-enabled
just
means that the following attributes are defined:

mail
legacyExchangeDN
proxyAddresses (SMTP and X.400)
textEncodedORAddress (X.400 address)
mailnickname
mAPIRecipient (set to FALSE. TRUE means a mailbox) targetAddresss
msExchPoliciesIncluded (The GUIDs for the Recipient Update Service - RUS
-
policies)

That should do it since the Recipient Update Service should take care of
the
rest.

Take a look at the Q articles regarding the Recipient Update Service.
It's
the service that updates attributes on mail(box)-enabled objects.

You could use ADSI or LDAP at that point. Just depends what your most
comfortable with.

Rick
---
Rick Tatem
SAS Institute

-----Original Message-----
From: Peter A. Peterson II [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 4:34 PM
To: [EMAIL PROTECTED]
Subject: MailEnable with Perl on win32?


I work for a small university in Chicago, and am what I'd call a movice
perl
coder -- that's a medium novice.

Anyway, our campus community is pretty well split between commuters and
on
campus students. And, since everyone's getting so net-saavy these days,
many
students come to school with email accounts that they already use
regularly
(hotmail, yahoo, etc.). We'd like to allow them to use a CGI to change
their
"on campus email address" to whatever their current "primary address"
is. 

This is the sort of overview of how we were thinking about doing it --
at
least, this is how it's done in the GUI (Exchange 2000):

1. Delete their mailbox.
2. MailEnable the AD user with the off campus address.
([EMAIL PROTECTED])

This allows their user to still show in the Global Address List, but
have
the address associated with it point off campus.

3. Add a secondary SMTP address for North Park (the school)
([EMAIL PROTECTED]) so that if someone sends email to that address it
will be redirected to their s00perwebmail account.

We're looking at doing this with either Perl or with VB -- I'm gunning
for
Perl myself. So I did some research into modules like Win32::Exchange to
see
what stuff was already modularized, and as far as I can tell, I can do
the
mailbox deletion and adding the secondary SMTP through that module, but
I
don't see a method for doing the MailEnable and adding the external
address.

Am I overlooking something? Or does this have to be done with the OLE
calls?
If someone could point me in the right direction on this, I'd be
grateful.

Thanks,

Peter

-- 
Peter A. Peterson II, technician and musician.
---=[ http://tastytronic.net/~pedro/ ]=---
_______________________________________________
Perl-Win32-Admin mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Admin mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


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

Reply via email to