Title: Microsoft CDO for Exchange Management Library IMailRecipient interface ForwardTo property.

What I need to do is turn e-mail forwarding on and off in a Windows2003/Exchange2003 environment.  Turning it on is ridiculously easy:

  use Win32::OLE;
  my $objPersonAdsPath = "LDAP://Server/CN=Some User,OU=RRU,DC=MyDomain,DC=ca";
  my $AltRecipientAdsPath = "LDAP://Server/CN=Some User's Contact,OU=RRU,DC=MyDomain,DC=ca";

  my $objUser = Win32::OLE->GetObject($objPersonAdsPath); 
  $objUser->Put("altRecipient", $AltRecipientAdsPath);
  $objUser->SetInfo;


Turning it off has me stumped.  I believe using the Microsoft CDO for Exchange Management Library IMailRecipient interface ForwardTo property is what I need to use.  I can retrieve the ForwardTo property value quite easily as well:

  my $objPersonAdsPath = "LDAP://Server/CN=Some User,OU=RRU,DC=MyDomain,DC=ca";
  my $objPerson = Win32::OLE->new("CDO.Person");
  $objPerson->DataSource->Open($objPersonAdsPath,undef,3);
  my $objMailbox = $objPerson->GetInterface(IMailRecipient);
  $Forward = $objMailbox->ForwardTo();
  print("$Forward\n");


I can’t for the life of me figure out how to set it!  $objMailbox->ForwardTo("anyvalue"); doesn't work.

Any help would be greatly appreciated….  I can't afford to lose any more hair… (:




--------
Darrell M. Pettyjohn, Royal Roads University, Victoria, B.C. Canada
Email:
[EMAIL PROTECTED]
Phone: 250 391 2533

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

Reply via email to