Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Does redemption require user to be logged on?

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Does redemption require user to be logged on?
"dcook23" <dcook23[ at ]gmail.com> 26.09.2006 18:59:04
I have created a script that uses SMTP to send an email off a
designated server and then uses redemption to check if the message has
arrived in the specified mailbox. The script is being automatically
kicked off by a monitoring product and running under an account that
has an Outlook profile setup. The script works great if the account is
logged on to the machine no matter if Outlook is already open or not.
If the account is not logged on then the script will not continue
beyond the line below.

set Inbox = Session.GetDefaultFolder(olFolderInbox)

I have tried to trap an error message but nothing after the line above
is executed but the script exits. My question is does redemption
require the user account be logged in?

The full piece of my code that is using redemption is below.
Const olFolderInbox = 6
set Session = CreateObject("Redemption.RDOSession")
Session.Logon

set Inbox = Session.GetDefaultFolder(olFolderInbox)
for each Msg in Inbox.Items
for each att in msg.Attachments
If lcase(left(att.filename,4)) = "fax-" Then
If DateDiff("n",msg.ReceivedTime,FaxSentTime) <
5 Then
vSuccess = "yes"
End If
End If
Next
msg.delete
Next

Re: Does redemption require user to be logged on?
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 26.09.2006 19:07:01
RDOSession does require a logon or an assignment of MAPIOBJECT. I would
check for Session.LoggedOn after the Logon call to verify that the session
is truly logged on.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"dcook23" <dcook23[ at ]gmail.com> wrote in message
news:1159297143.883544.169010[ at ]i3g2000cwc.googlegroups.com...
[Quoted Text]
>I have created a script that uses SMTP to send an email off a
> designated server and then uses redemption to check if the message has
> arrived in the specified mailbox. The script is being automatically
> kicked off by a monitoring product and running under an account that
> has an Outlook profile setup. The script works great if the account is
> logged on to the machine no matter if Outlook is already open or not.
> If the account is not logged on then the script will not continue
> beyond the line below.
>
> set Inbox = Session.GetDefaultFolder(olFolderInbox)
>
> I have tried to trap an error message but nothing after the line above
> is executed but the script exits. My question is does redemption
> require the user account be logged in?
>
> The full piece of my code that is using redemption is below.
> Const olFolderInbox = 6
> set Session = CreateObject("Redemption.RDOSession")
> Session.Logon
>
> set Inbox = Session.GetDefaultFolder(olFolderInbox)
> for each Msg in Inbox.Items
> for each att in msg.Attachments
> If lcase(left(att.filename,4)) = "fax-" Then
> If DateDiff("n",msg.ReceivedTime,FaxSentTime) <
> 5 Then
> vSuccess = "yes"
> End If
> End If
> Next
> msg.delete
> Next
>

Re: Does redemption require user to be logged on?
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 26.09.2006 21:34:41
Do you mean whether it makes any difference which Windows user identity your
code is running under? Of course, RDOSession.Logon will try to log to the
default profile, which clearly depends on who the user is. It is possible
that the current user (e.g. local service account) does not have any
profiles at all. Or (if you are impersonating a user), the HKCU registry
hive (where the profile are stored) for that user are not loaded.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dcook23" <dcook23[ at ]gmail.com> wrote in message
news:1159297143.883544.169010[ at ]i3g2000cwc.googlegroups.com...
[Quoted Text]
>I have created a script that uses SMTP to send an email off a
> designated server and then uses redemption to check if the message has
> arrived in the specified mailbox. The script is being automatically
> kicked off by a monitoring product and running under an account that
> has an Outlook profile setup. The script works great if the account is
> logged on to the machine no matter if Outlook is already open or not.
> If the account is not logged on then the script will not continue
> beyond the line below.
>
> set Inbox = Session.GetDefaultFolder(olFolderInbox)
>
> I have tried to trap an error message but nothing after the line above
> is executed but the script exits. My question is does redemption
> require the user account be logged in?
>
> The full piece of my code that is using redemption is below.
> Const olFolderInbox = 6
> set Session = CreateObject("Redemption.RDOSession")
> Session.Logon
>
> set Inbox = Session.GetDefaultFolder(olFolderInbox)
> for each Msg in Inbox.Items
> for each att in msg.Attachments
> If lcase(left(att.filename,4)) = "fax-" Then
> If DateDiff("n",msg.ReceivedTime,FaxSentTime) <
> 5 Then
> vSuccess = "yes"
> End If
> End If
> Next
> msg.delete
> Next
>


Re: Does redemption require user to be logged on?
"dcook23" <dcook23[ at ]gmail.com> 27.09.2006 20:43:36
Thank you for the reply.

The monitoring product that executing the script is executing it using
a run as so it is running using the credentials of the account that has
the Outlook profile configured. Is this not enough to load the hive
where the profile is stored?

Would using the MAPIOBJECT make any difference?


Dmitry Streblechenko wrote:
[Quoted Text]
> Do you mean whether it makes any difference which Windows user identity your
> code is running under? Of course, RDOSession.Logon will try to log to the
> default profile, which clearly depends on who the user is. It is possible
> that the current user (e.g. local service account) does not have any
> profiles at all. Or (if you are impersonating a user), the HKCU registry
> hive (where the profile are stored) for that user are not loaded.
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "dcook23" <dcook23[ at ]gmail.com> wrote in message
> news:1159297143.883544.169010[ at ]i3g2000cwc.googlegroups.com...
> >I have created a script that uses SMTP to send an email off a
> > designated server and then uses redemption to check if the message has
> > arrived in the specified mailbox. The script is being automatically
> > kicked off by a monitoring product and running under an account that
> > has an Outlook profile setup. The script works great if the account is
> > logged on to the machine no matter if Outlook is already open or not.
> > If the account is not logged on then the script will not continue
> > beyond the line below.
> >
> > set Inbox = Session.GetDefaultFolder(olFolderInbox)
> >
> > I have tried to trap an error message but nothing after the line above
> > is executed but the script exits. My question is does redemption
> > require the user account be logged in?
> >
> > The full piece of my code that is using redemption is below.
> > Const olFolderInbox = 6
> > set Session = CreateObject("Redemption.RDOSession")
> > Session.Logon
> >
> > set Inbox = Session.GetDefaultFolder(olFolderInbox)
> > for each Msg in Inbox.Items
> > for each att in msg.Attachments
> > If lcase(left(att.filename,4)) = "fax-" Then
> > If DateDiff("n",msg.ReceivedTime,FaxSentTime) <
> > 5 Then
> > vSuccess = "yes"
> > End If
> > End If
> > Next
> > msg.delete
> > Next
> >

Re: Does redemption require user to be logged on?
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 27.09.2006 21:36:14
Did you try to specify an explicit profile name when calling
RDOSession.Logon? How did you trap the error?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dcook23" <dcook23[ at ]gmail.com> wrote in message
news:1159389816.414018.171760[ at ]i42g2000cwa.googlegroups.com...
[Quoted Text]
> Thank you for the reply.
>
> The monitoring product that executing the script is executing it using
> a run as so it is running using the credentials of the account that has
> the Outlook profile configured. Is this not enough to load the hive
> where the profile is stored?
>
> Would using the MAPIOBJECT make any difference?
>
>
> Dmitry Streblechenko wrote:
>> Do you mean whether it makes any difference which Windows user identity
>> your
>> code is running under? Of course, RDOSession.Logon will try to log to the
>> default profile, which clearly depends on who the user is. It is possible
>> that the current user (e.g. local service account) does not have any
>> profiles at all. Or (if you are impersonating a user), the HKCU registry
>> hive (where the profile are stored) for that user are not loaded.
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "dcook23" <dcook23[ at ]gmail.com> wrote in message
>> news:1159297143.883544.169010[ at ]i3g2000cwc.googlegroups.com...
>> >I have created a script that uses SMTP to send an email off a
>> > designated server and then uses redemption to check if the message has
>> > arrived in the specified mailbox. The script is being automatically
>> > kicked off by a monitoring product and running under an account that
>> > has an Outlook profile setup. The script works great if the account is
>> > logged on to the machine no matter if Outlook is already open or not.
>> > If the account is not logged on then the script will not continue
>> > beyond the line below.
>> >
>> > set Inbox = Session.GetDefaultFolder(olFolderInbox)
>> >
>> > I have tried to trap an error message but nothing after the line above
>> > is executed but the script exits. My question is does redemption
>> > require the user account be logged in?
>> >
>> > The full piece of my code that is using redemption is below.
>> > Const olFolderInbox = 6
>> > set Session = CreateObject("Redemption.RDOSession")
>> > Session.Logon
>> >
>> > set Inbox = Session.GetDefaultFolder(olFolderInbox)
>> > for each Msg in Inbox.Items
>> > for each att in msg.Attachments
>> > If lcase(left(att.filename,4)) = "fax-" Then
>> > If DateDiff("n",msg.ReceivedTime,FaxSentTime) <
>> > 5 Then
>> > vSuccess = "yes"
>> > End If
>> > End If
>> > Next
>> > msg.delete
>> > Next
>> >
>


Re: Does redemption require user to be logged on?
"dcook23" <dcook23[ at ]gmail.com> 27.09.2006 21:51:40
I tried specifying the profile name and I get the same results.

I have also tried trapping an error with no luck. I setup the script to
create a log file when it runs. The logon code looks like this to do my
logging:

' Use redemption to logon to default MAPI profile
set Session = CreateObject("Redemption.RDOSession")
objFile.writeline "going to logon"
Session.Logon
ObjFile.writeline "post logon"
objFile.writeline session.loggedon

If I have the user account logged into the server when the monitoring
product kicks off the script I get the following written to my log:

going to logon
post logon
True

If the user account is not logged onto the machine when the script
kicks off I get only the line that says "going to logon" and nothing
more. I have also tried using "On Error Resume Next" before the logon
even and then writing err.number immediately after logon. That results
in 0 when the account is logged on and nothing is writen after "going
to logon" when the account is not logged on. It appears the script
exits at the "Session.Logon" if the account is not logged on.

Does this make sense? Does anyone know if I should be able to get this
to work without having the account logged in?

I very much appreciate the help.


Dmitry Streblechenko wrote:
[Quoted Text]
> Did you try to specify an explicit profile name when calling
> RDOSession.Logon? How did you trap the error?
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "dcook23" <dcook23[ at ]gmail.com> wrote in message
> news:1159389816.414018.171760[ at ]i42g2000cwa.googlegroups.com...
> > Thank you for the reply.
> >
> > The monitoring product that executing the script is executing it using
> > a run as so it is running using the credentials of the account that has
> > the Outlook profile configured. Is this not enough to load the hive
> > where the profile is stored?
> >
> > Would using the MAPIOBJECT make any difference?
> >
> >
> > Dmitry Streblechenko wrote:
> >> Do you mean whether it makes any difference which Windows user identity
> >> your
> >> code is running under? Of course, RDOSession.Logon will try to log to the
> >> default profile, which clearly depends on who the user is. It is possible
> >> that the current user (e.g. local service account) does not have any
> >> profiles at all. Or (if you are impersonating a user), the HKCU registry
> >> hive (where the profile are stored) for that user are not loaded.
> >>
> >> Dmitry Streblechenko (MVP)
> >> http://www.dimastr.com/
> >> OutlookSpy - Outlook, CDO
> >> and MAPI Developer Tool
> >>
> >> "dcook23" <dcook23[ at ]gmail.com> wrote in message
> >> news:1159297143.883544.169010[ at ]i3g2000cwc.googlegroups.com...
> >> >I have created a script that uses SMTP to send an email off a
> >> > designated server and then uses redemption to check if the message has
> >> > arrived in the specified mailbox. The script is being automatically
> >> > kicked off by a monitoring product and running under an account that
> >> > has an Outlook profile setup. The script works great if the account is
> >> > logged on to the machine no matter if Outlook is already open or not.
> >> > If the account is not logged on then the script will not continue
> >> > beyond the line below.
> >> >
> >> > set Inbox = Session.GetDefaultFolder(olFolderInbox)
> >> >
> >> > I have tried to trap an error message but nothing after the line above
> >> > is executed but the script exits. My question is does redemption
> >> > require the user account be logged in?
> >> >
> >> > The full piece of my code that is using redemption is below.
> >> > Const olFolderInbox = 6
> >> > set Session = CreateObject("Redemption.RDOSession")
> >> > Session.Logon
> >> >
> >> > set Inbox = Session.GetDefaultFolder(olFolderInbox)
> >> > for each Msg in Inbox.Items
> >> > for each att in msg.Attachments
> >> > If lcase(left(att.filename,4)) = "fax-" Then
> >> > If DateDiff("n",msg.ReceivedTime,FaxSentTime) <
> >> > 5 Then
> >> > vSuccess = "yes"
> >> > End If
> >> > End If
> >> > Next
> >> > msg.delete
> >> > Next
> >> >
> >

Re: Does redemption require user to be logged on?
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 28.09.2006 17:15:26
Hmmm.. Is that a PST or an Exchange mailbox?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dcook23" <dcook23[ at ]gmail.com> wrote in message
news:1159393900.273485.180050[ at ]b28g2000cwb.googlegroups.com...
[Quoted Text]
>I tried specifying the profile name and I get the same results.
>
> I have also tried trapping an error with no luck. I setup the script to
> create a log file when it runs. The logon code looks like this to do my
> logging:
>
> ' Use redemption to logon to default MAPI profile
> set Session = CreateObject("Redemption.RDOSession")
> objFile.writeline "going to logon"
> Session.Logon
> ObjFile.writeline "post logon"
> objFile.writeline session.loggedon
>
> If I have the user account logged into the server when the monitoring
> product kicks off the script I get the following written to my log:
>
> going to logon
> post logon
> True
>
> If the user account is not logged onto the machine when the script
> kicks off I get only the line that says "going to logon" and nothing
> more. I have also tried using "On Error Resume Next" before the logon
> even and then writing err.number immediately after logon. That results
> in 0 when the account is logged on and nothing is writen after "going
> to logon" when the account is not logged on. It appears the script
> exits at the "Session.Logon" if the account is not logged on.
>
> Does this make sense? Does anyone know if I should be able to get this
> to work without having the account logged in?
>
> I very much appreciate the help.
>
>
> Dmitry Streblechenko wrote:
>> Did you try to specify an explicit profile name when calling
>> RDOSession.Logon? How did you trap the error?
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "dcook23" <dcook23[ at ]gmail.com> wrote in message
>> news:1159389816.414018.171760[ at ]i42g2000cwa.googlegroups.com...
>> > Thank you for the reply.
>> >
>> > The monitoring product that executing the script is executing it using
>> > a run as so it is running using the credentials of the account that has
>> > the Outlook profile configured. Is this not enough to load the hive
>> > where the profile is stored?
>> >
>> > Would using the MAPIOBJECT make any difference?
>> >
>> >
>> > Dmitry Streblechenko wrote:
>> >> Do you mean whether it makes any difference which Windows user
>> >> identity
>> >> your
>> >> code is running under? Of course, RDOSession.Logon will try to log to
>> >> the
>> >> default profile, which clearly depends on who the user is. It is
>> >> possible
>> >> that the current user (e.g. local service account) does not have any
>> >> profiles at all. Or (if you are impersonating a user), the HKCU
>> >> registry
>> >> hive (where the profile are stored) for that user are not loaded.
>> >>
>> >> Dmitry Streblechenko (MVP)
>> >> http://www.dimastr.com/
>> >> OutlookSpy - Outlook, CDO
>> >> and MAPI Developer Tool
>> >>
>> >> "dcook23" <dcook23[ at ]gmail.com> wrote in message
>> >> news:1159297143.883544.169010[ at ]i3g2000cwc.googlegroups.com...
>> >> >I have created a script that uses SMTP to send an email off a
>> >> > designated server and then uses redemption to check if the message
>> >> > has
>> >> > arrived in the specified mailbox. The script is being automatically
>> >> > kicked off by a monitoring product and running under an account that
>> >> > has an Outlook profile setup. The script works great if the account
>> >> > is
>> >> > logged on to the machine no matter if Outlook is already open or
>> >> > not.
>> >> > If the account is not logged on then the script will not continue
>> >> > beyond the line below.
>> >> >
>> >> > set Inbox = Session.GetDefaultFolder(olFolderInbox)
>> >> >
>> >> > I have tried to trap an error message but nothing after the line
>> >> > above
>> >> > is executed but the script exits. My question is does redemption
>> >> > require the user account be logged in?
>> >> >
>> >> > The full piece of my code that is using redemption is below.
>> >> > Const olFolderInbox = 6
>> >> > set Session = CreateObject("Redemption.RDOSession")
>> >> > Session.Logon
>> >> >
>> >> > set Inbox = Session.GetDefaultFolder(olFolderInbox)
>> >> > for each Msg in Inbox.Items
>> >> > for each att in msg.Attachments
>> >> > If lcase(left(att.filename,4)) = "fax-" Then
>> >> > If DateDiff("n",msg.ReceivedTime,FaxSentTime)
>> >> > <
>> >> > 5 Then
>> >> > vSuccess = "yes"
>> >> > End If
>> >> > End If
>> >> > Next
>> >> > msg.delete
>> >> > Next
>> >> >
>> >
>


Re: Does redemption require user to be logged on?
"dcook23" <dcook23[ at ]gmail.com> 29.09.2006 17:57:29
It is an Exchange mailbox. I initially tried the LogonExchangeMailbox
method but that was failing on the GetDefaultFolder so I thought maybe
I had to use a different method for that method to work.

Dmitry Streblechenko wrote:
[Quoted Text]
> Hmmm.. Is that a PST or an Exchange mailbox?
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "dcook23" <dcook23[ at ]gmail.com> wrote in message
> news:1159393900.273485.180050[ at ]b28g2000cwb.googlegroups.com...
> >I tried specifying the profile name and I get the same results.
> >
> > I have also tried trapping an error with no luck. I setup the script to
> > create a log file when it runs. The logon code looks like this to do my
> > logging:
> >
> > ' Use redemption to logon to default MAPI profile
> > set Session = CreateObject("Redemption.RDOSession")
> > objFile.writeline "going to logon"
> > Session.Logon
> > ObjFile.writeline "post logon"
> > objFile.writeline session.loggedon
> >
> > If I have the user account logged into the server when the monitoring
> > product kicks off the script I get the following written to my log:
> >
> > going to logon
> > post logon
> > True
> >
> > If the user account is not logged onto the machine when the script
> > kicks off I get only the line that says "going to logon" and nothing
> > more. I have also tried using "On Error Resume Next" before the logon
> > even and then writing err.number immediately after logon. That results
> > in 0 when the account is logged on and nothing is writen after "going
> > to logon" when the account is not logged on. It appears the script
> > exits at the "Session.Logon" if the account is not logged on.
> >
> > Does this make sense? Does anyone know if I should be able to get this
> > to work without having the account logged in?
> >
> > I very much appreciate the help.
> >
> >
> > Dmitry Streblechenko wrote:
> >> Did you try to specify an explicit profile name when calling
> >> RDOSession.Logon? How did you trap the error?
> >>
> >> Dmitry Streblechenko (MVP)
> >> http://www.dimastr.com/
> >> OutlookSpy - Outlook, CDO
> >> and MAPI Developer Tool
> >>
> >> "dcook23" <dcook23[ at ]gmail.com> wrote in message
> >> news:1159389816.414018.171760[ at ]i42g2000cwa.googlegroups.com...
> >> > Thank you for the reply.
> >> >
> >> > The monitoring product that executing the script is executing it using
> >> > a run as so it is running using the credentials of the account that has
> >> > the Outlook profile configured. Is this not enough to load the hive
> >> > where the profile is stored?
> >> >
> >> > Would using the MAPIOBJECT make any difference?
> >> >
> >> >
> >> > Dmitry Streblechenko wrote:
> >> >> Do you mean whether it makes any difference which Windows user
> >> >> identity
> >> >> your
> >> >> code is running under? Of course, RDOSession.Logon will try to log to
> >> >> the
> >> >> default profile, which clearly depends on who the user is. It is
> >> >> possible
> >> >> that the current user (e.g. local service account) does not have any
> >> >> profiles at all. Or (if you are impersonating a user), the HKCU
> >> >> registry
> >> >> hive (where the profile are stored) for that user are not loaded.
> >> >>
> >> >> Dmitry Streblechenko (MVP)
> >> >> http://www.dimastr.com/
> >> >> OutlookSpy - Outlook, CDO
> >> >> and MAPI Developer Tool
> >> >>
> >> >> "dcook23" <dcook23[ at ]gmail.com> wrote in message
> >> >> news:1159297143.883544.169010[ at ]i3g2000cwc.googlegroups.com...
> >> >> >I have created a script that uses SMTP to send an email off a
> >> >> > designated server and then uses redemption to check if the message
> >> >> > has
> >> >> > arrived in the specified mailbox. The script is being automatically
> >> >> > kicked off by a monitoring product and running under an account that
> >> >> > has an Outlook profile setup. The script works great if the account
> >> >> > is
> >> >> > logged on to the machine no matter if Outlook is already open or
> >> >> > not.
> >> >> > If the account is not logged on then the script will not continue
> >> >> > beyond the line below.
> >> >> >
> >> >> > set Inbox = Session.GetDefaultFolder(olFolderInbox)
> >> >> >
> >> >> > I have tried to trap an error message but nothing after the line
> >> >> > above
> >> >> > is executed but the script exits. My question is does redemption
> >> >> > require the user account be logged in?
> >> >> >
> >> >> > The full piece of my code that is using redemption is below.
> >> >> > Const olFolderInbox = 6
> >> >> > set Session = CreateObject("Redemption.RDOSession")
> >> >> > Session.Logon
> >> >> >
> >> >> > set Inbox = Session.GetDefaultFolder(olFolderInbox)
> >> >> > for each Msg in Inbox.Items
> >> >> > for each att in msg.Attachments
> >> >> > If lcase(left(att.filename,4)) = "fax-" Then
> >> >> > If DateDiff("n",msg.ReceivedTime,FaxSentTime)
> >> >> > <
> >> >> > 5 Then
> >> >> > vSuccess = "yes"
> >> >> > End If
> >> >> > End If
> >> >> > Next
> >> >> > msg.delete
> >> >> > Next
> >> >> >
> >> >
> >

Re: Does redemption require user to be logged on?
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 29.09.2006 18:57:17
Contact me at my private e-mail address - I'll send you a debug version that
creates a log file.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"dcook23" <dcook23[ at ]gmail.com> wrote in message
news:1159552649.621623.269890[ at ]i42g2000cwa.googlegroups.com...
[Quoted Text]
> It is an Exchange mailbox. I initially tried the LogonExchangeMailbox
> method but that was failing on the GetDefaultFolder so I thought maybe
> I had to use a different method for that method to work.
>
> Dmitry Streblechenko wrote:
>> Hmmm.. Is that a PST or an Exchange mailbox?
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "dcook23" <dcook23[ at ]gmail.com> wrote in message
>> news:1159393900.273485.180050[ at ]b28g2000cwb.googlegroups.com...
>> >I tried specifying the profile name and I get the same results.
>> >
>> > I have also tried trapping an error with no luck. I setup the script to
>> > create a log file when it runs. The logon code looks like this to do my
>> > logging:
>> >
>> > ' Use redemption to logon to default MAPI profile
>> > set Session = CreateObject("Redemption.RDOSession")
>> > objFile.writeline "going to logon"
>> > Session.Logon
>> > ObjFile.writeline "post logon"
>> > objFile.writeline session.loggedon
>> >
>> > If I have the user account logged into the server when the monitoring
>> > product kicks off the script I get the following written to my log:
>> >
>> > going to logon
>> > post logon
>> > True
>> >
>> > If the user account is not logged onto the machine when the script
>> > kicks off I get only the line that says "going to logon" and nothing
>> > more. I have also tried using "On Error Resume Next" before the logon
>> > even and then writing err.number immediately after logon. That results
>> > in 0 when the account is logged on and nothing is writen after "going
>> > to logon" when the account is not logged on. It appears the script
>> > exits at the "Session.Logon" if the account is not logged on.
>> >
>> > Does this make sense? Does anyone know if I should be able to get this
>> > to work without having the account logged in?
>> >
>> > I very much appreciate the help.
>> >
>> >
>> > Dmitry Streblechenko wrote:
>> >> Did you try to specify an explicit profile name when calling
>> >> RDOSession.Logon? How did you trap the error?
>> >>
>> >> Dmitry Streblechenko (MVP)
>> >> http://www.dimastr.com/
>> >> OutlookSpy - Outlook, CDO
>> >> and MAPI Developer Tool
>> >>
>> >> "dcook23" <dcook23[ at ]gmail.com> wrote in message
>> >> news:1159389816.414018.171760[ at ]i42g2000cwa.googlegroups.com...
>> >> > Thank you for the reply.
>> >> >
>> >> > The monitoring product that executing the script is executing it
>> >> > using
>> >> > a run as so it is running using the credentials of the account that
>> >> > has
>> >> > the Outlook profile configured. Is this not enough to load the hive
>> >> > where the profile is stored?
>> >> >
>> >> > Would using the MAPIOBJECT make any difference?
>> >> >
>> >> >
>> >> > Dmitry Streblechenko wrote:
>> >> >> Do you mean whether it makes any difference which Windows user
>> >> >> identity
>> >> >> your
>> >> >> code is running under? Of course, RDOSession.Logon will try to log
>> >> >> to
>> >> >> the
>> >> >> default profile, which clearly depends on who the user is. It is
>> >> >> possible
>> >> >> that the current user (e.g. local service account) does not have
>> >> >> any
>> >> >> profiles at all. Or (if you are impersonating a user), the HKCU
>> >> >> registry
>> >> >> hive (where the profile are stored) for that user are not loaded.
>> >> >>
>> >> >> Dmitry Streblechenko (MVP)
>> >> >> http://www.dimastr.com/
>> >> >> OutlookSpy - Outlook, CDO
>> >> >> and MAPI Developer Tool
>> >> >>
>> >> >> "dcook23" <dcook23[ at ]gmail.com> wrote in message
>> >> >> news:1159297143.883544.169010[ at ]i3g2000cwc.googlegroups.com...
>> >> >> >I have created a script that uses SMTP to send an email off a
>> >> >> > designated server and then uses redemption to check if the
>> >> >> > message
>> >> >> > has
>> >> >> > arrived in the specified mailbox. The script is being
>> >> >> > automatically
>> >> >> > kicked off by a monitoring product and running under an account
>> >> >> > that
>> >> >> > has an Outlook profile setup. The script works great if the
>> >> >> > account
>> >> >> > is
>> >> >> > logged on to the machine no matter if Outlook is already open or
>> >> >> > not.
>> >> >> > If the account is not logged on then the script will not continue
>> >> >> > beyond the line below.
>> >> >> >
>> >> >> > set Inbox = Session.GetDefaultFolder(olFolderInbox)
>> >> >> >
>> >> >> > I have tried to trap an error message but nothing after the line
>> >> >> > above
>> >> >> > is executed but the script exits. My question is does redemption
>> >> >> > require the user account be logged in?
>> >> >> >
>> >> >> > The full piece of my code that is using redemption is below.
>> >> >> > Const olFolderInbox = 6
>> >> >> > set Session = CreateObject("Redemption.RDOSession")
>> >> >> > Session.Logon
>> >> >> >
>> >> >> > set Inbox = Session.GetDefaultFolder(olFolderInbox)
>> >> >> > for each Msg in Inbox.Items
>> >> >> > for each att in msg.Attachments
>> >> >> > If lcase(left(att.filename,4)) = "fax-" Then
>> >> >> > If
>> >> >> > DateDiff("n",msg.ReceivedTime,FaxSentTime)
>> >> >> > <
>> >> >> > 5 Then
>> >> >> > vSuccess = "yes"
>> >> >> > End If
>> >> >> > End If
>> >> >> > Next
>> >> >> > msg.delete
>> >> >> > Next
>> >> >> >
>> >> >
>> >
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net