Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Outlook.Application Namespace.Logon issue

336 views
Skip to first unread message

david....@swagelok.com

unread,
Feb 22, 2001, 8:15:25 AM2/22/01
to
Hi,

I am having trouble trying to get a vbscript to work that attempts to logon
without the use of a dialog box. I am specifically using DTS withing SQL
Server, but I don't think that matters. My issue is when I set the dialog
property to False and provide a username and password, I do not get an error,
but the logon does not seem to be successful. If I allow the dialog to
appear and type the same password, it logs on properly and everything is
fine. I am using Outlook 2000 with NT4 SP5. Any ideas?

Thanks,

Dave

Sample script (from a DTS activeX script task)

Function Main()
mail_error = ReadTheMail

Main = DTSTaskExecResult_Success
End Function

Function ReadTheMail
stop
Set oOutlook = CreateObject("Outlook.application")
Set oNamespace = oOutlook.GetNamespace("MAPI")
oNamespace.Name = "KBraun"

'objnamespace.Logon "KBraun" , , True, True ' #1 - This works -
Prompts
for profile, type in password, and continues fine.
oNamespace.Logon "KBraun", "cccccccc", False, False ' #2 -
Continues past
this fine

' ***** msgbox objOutlook.Session ' Returns Mapi
msgbox oNamespace.CurrentUser.Name 'Get Unknown user with #2 / Get correct
name with #1

set oFolder = oNamespace.GetDefaultFolder(6) 'Get Error - This information
store could not be opened -2147221231

End Function

----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email ab...@newsone.net

david....@swagelok.com

unread,
Feb 22, 2001, 11:27:18 AM2/22/01
to
I apologize, but the previous script was a result of some testing. This one
is "cleaned up".

Thanks,

Dave


'Try this code with #1 commented out
'Then try with #2 commented out


Set oOutlook = CreateObject("Outlook.application")
Set oNamespace = oOutlook.GetNamespace("MAPI")

' #1 - This works - Prompts for profile, type in password, and continues


fine.
'objnamespace.Logon "KBraun" , , True, True

' #2 -Continues past this fine
oNamespace.Logon "KBraun", "cccccccc", False, True

' ***** msgbox objOutlook.Session ' Returns Mapi
msgbox oNamespace.CurrentUser.Name 'Get Unknown user with #2 / Get
correct name with #1

set oFolder = oNamespace.GetDefaultFolder(6)
'Get Error with #2 - This information store could not be opened -2147221231

Dmitry Streblechenko

unread,
Feb 22, 2001, 11:49:25 PM2/22/01
to
The password parameter is a relic of the MS Mail days. It is *not* an NT
password. Outlook uses NT authentication, if you are logged in to the domain, it
can logon silently; if you are not logged to the domain (e.g. you are running
under a local account), the prompt is necessary.

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

<david....@swagelok.com> wrote in message
news:9733dd$rfv$1...@news.netmar.com...

david....@swagelok.com

unread,
Feb 23, 2001, 9:02:17 AM2/23/01
to
Is there any way to use a different Outlook profile then other than the
domain account your signed in as without having to go through a dialog box?
(Maybe through some other hopefully "scriptable" object?) (in my case I set
the Logon network security under Control Panel, Mail, ... Properties,
Advanced setting for this other profile to "none") I am gathering from the
previous response that there is not -- but that seems kind of inflexible.

In my case I am logged onto the domain, say domain XXX, as xxx\dgabele. The
other account exists in the same domain say as xxx\kbraun. I set up a
Outlook profile for kbraun under the xxx domain on my machine (the one I am
logged on as xxx\dgabele).

Thanks,

Dave

In article <#EZnGQVnAHA.1356@tkmsftngp04>, Dmitry Streblechenko


----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----

Dmitry Streblechenko

unread,
Feb 23, 2001, 12:38:41 PM2/23/01
to
No, Outlook will not let you login to a mailbox of another user unless you are
logged in to NT as that user.

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

<david....@swagelok.com> wrote in message
news:975qh9$3go$1...@news.netmar.com...

0 new messages