Re: outlook and win32 service




On 9 Apr 2008, at 12:50, BENI wrote:
On Apr 9, 12:34 am, "Nation, Carey" <Carey.Nat...@xxxxxxxxxx> wrote:
Who is the service running as? It's going to need to run as the
owner
of the inbox for this to stand a chance. Is this exchange server
or pop
mail? If it's exchange server, remember that it uses integrated
authorization; so again, you'll need the correct user as the
service's
login user. If it's pop, it's just because it's reading the wrong
set
of things in "Documents and Settings" and maybe the registry.


Thanks for your inputs

1>I am using office2003 and outlook2003 in it. So I am using pop mail
I guess.

I don't remember what your original task was, but have you considered
using Net::POP?



Now how do i configure my service code's service login user?

do i have add this part of the code?

:service_start_name => 'SomeDomain\\User' onto my svc object?


svc= Service.new(SERVICE_NAME, nil,{
:service_type => Service::WIN32_OWN_PROCESS,
:description => SERVICE_DISPLAYNAME,
:start_type => Service::AUTO_START,
:error_control => Service::ERROR_NORMAL,
:binary_path_name => cmd,
:load_order_group => 'Network',
:dependencies => ['W32Time','Schedule'],
:display_name => 'Kpi-file-Scanner'}
)

2>Also I found this link http://support.microsoft.com/kb/237913 which
says (The Outlook Object Model is unsuitable to run in a Windows
service) that is very discouraging.

I do not know the specifics, but doing my own work I recently ran into
the issues of how sandboxed the services are.

3>What I am unable to still understand when i run the following

require 'win32ole'
outlook = WIN32OLE.new('Outlook.Application')
mapi = outlook.GetNameSpace('MAPI')
inbox = mapi.GetDefaultFolder(6)
file_c=1
puts "#{inbox.UnreadItemCount}:so many unread messages"
puts "#{inbox.Items.Count}:so many messages"

.. I get perfect ouput... and looking onto windows process i find
oulook.exe running under SYSTEM ...but still I get the right output.

....


You may be able to do this by hacking the User HIVE in order to
authorize SYSTEM with access to the users registry, and then there's a
dual logon hack you can use to ensure that a SYSTEM logon will load
the target users hive into memory. Sadly this is a major security
issue that you will raise, and the process is very complicated
(involving copying various hashes around under regedit32 running as
SYSTEM iirc, and you might even need to sort out some UTF8 interface
problems iirc). This is most typically used for laptop users that need
local administrator rights, but cannot be administrators in the
controlling domain. The users traditionally had two user accounts, but
using the same technique one can effectively 'log on' as both users
simultaneously.


Finally, I might also suggest that there's no need to service this.
You should be able to create either an outlook plugin or a new outlook
'launcher' (using COM, almost as you have already done) in order to
run this process whenever outlook is running. From this point you may
then consider using a standard 'daemonizing' tool such as firedaemon
(I've never used that, but I have seen it running 'normal' windows
processes under a service wrapper) for solving the problem of service
restrictions.

HTH

.



Relevant Pages

  • Re: OLE 6 Taking forever to open after hardware upgrade
    ... >>> the repair on Windows XP to get the system to recognize my new ... Question here is now when I go to open Outlook Express 6 ... >>> reach a point (my inbox) where I am able to actually check for new ... >> a slow down will find a error in the system error log saying The ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: What is WMS Idle
    ... > what WMS is or where to find it, and the only way I can log out of Windows ... run a repair install on Outlook and reinstall Outlook updates (Outlook from ... the portion for Exchange server by mistake. ...
    (microsoft.public.windowsxp.accessibility)
  • Re: OLE 6 Taking forever to open after hardware upgrade
    ... > the repair on Windows XP to get the system to recognize my new ... Question here is now when I go to open Outlook Express 6 to ... > point (my inbox) where I am able to actually check for new e-mail. ... when they remove windows messenger or just disable it ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Outlook authentication
    ... Windows Registry Editor Version 5.00 ... > users being able to access the exchange server through outlook. ... > BUT if someone who has administrator rights types in their ... What is outlook doing behind the scenes when you start it up. ...
    (microsoft.public.exchange2000.clients)
  • Re: How to rename the inbox folder in Outlook 2000
    ... Exchange server or Outlook 2000? ... >Japanese & Chinese characters as INBOX. ... >>Do you know how to rename the inbox folder in Outlook ...
    (microsoft.public.outlook)