0

We are using Redemption Library to access our e-mails. Scripts are automated on server and triggered by Task Scheduler at regular intervals. After server reboots we usually experience the problem with Session.Logon, since the user needs to log on again.

To avoid this problem, we are trying now to use LogonHostedExchangeMailbox Session method. Due to unknown reason the script gets stuck at this command. Could anyone advise what the reason might be? Here is the sample:

set Session = CreateObject("Redemption.RDOSession")
InboxName = "xxx@domain.com"


Session.LogonHostedExchangeMailbox InboxName,InboxName, "pwd" 'the script gets stuck here and does not throw any errors. 

set oFolder = Session.GetFolderFromPath("\\"&InboxName&"\Inbox")


set items = oFolder.items
i = items.count 
do until i = 0 
    if items.count > 0 then
        set Mail = Items.Item(i)
        wscript.echo Mail.Subject
        'wscript.echo Mail.Body 
    end if 
    i = i - 1
loop 


Session.Logoff

Thanks.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
Nik Ohler
  • 75
  • 9
  • Looking at [the documentation](https://dimastr.com/redemption/rdosession.htm) it looks as though `LogonHostedExchangeMailbox()` - "The connection settings are retrieved using [Exchange Autodiscover Service](http://technet.microsoft.com/en-us/library/bb332063(v=exchg.80).aspx) and a temporary profile is created that uses RPC-over-HTTP (ROH) to connect to the mailbox under Outlook 2013. When Outlook 2016 is used, the profile is automatically configured by the MSEMS provider to use either MAPI-over-HTTP or RPC-over-HTTP depending on the Exchange Server version and its settings." – user692942 Feb 02 '22 at 18:00
  • So chances are the call is being deferred to these services and being lost, because it requires some handshake with Outlook (like displaying a dialog) so doesn't lend itself to automation. – user692942 Feb 02 '22 at 18:02
  • 1
    Please send a message to redemption (at) dimastr (dot) com and I will send you the debug version of Redemption. – Dmitry Streblechenko Feb 02 '22 at 18:07
  • 1
    @DmitryStreblechenko - just sent you the email. thank you. – Nik Ohler Feb 02 '22 at 18:14

0 Answers0