locked
Determining the Outlook Offline Status on a server remotely RRS feed

  • Question

  • Hi All, I'm currently working on a project that can remotely monitor the offline status of Outlook that is running on a server. 

    Overview: I have a VM who's only function to to check and forward a specific email once a day. I need to know when  the VM is down, Outlook is not running or Outlook is offline. I have been able to determine if the VM is down and if outlook is running but I'm struggling with the offline status Outlook.

    Here is my code (straight foward)...vbscript

    strComputer = "VMEmail"

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2", "outlook.Application")
    PD_VM_OTKSTATUS = objWMIService.Session.Offline
    Wscript.Echo PD_VM_OTKSTATUS

    I'm getting a error "File name or class not found during Automation operation: 'GetObject'"  Code: 800A01B0

    I want to run this script from my machine. If you know whats going on or a better way to solve my problem let me know I'm open to suggestions. Also I don't consider myself a programmer/coder I'm just able to take other code and make it work the way I want.

    Thanks in advance

    • Moved by Bill_Stewart Thursday, September 25, 2014 8:47 PM This is not "scripts on demand"
    Friday, September 5, 2014 1:19 PM

Answers

  • I should also note that you cannot get a link to a remote application.  You can run a script on the server that can  attach locally.

    You would find it better to write a macro in Outlook that monitors the online status  (which will only show online if you are using Exchange direct and not SMTP.

    The VBA code can be looped to look for the connection and alert when it fails.

    It would make more sense to have Exchange forward the mail and dump the VM.


    ¯\_(ツ)_/¯

    • Proposed as answer by Mike Laughlin Friday, September 5, 2014 2:34 PM
    • Marked as answer by Just Karl Tuesday, June 2, 2015 10:37 PM
    Friday, September 5, 2014 2:13 PM

All replies

  • This is the issue with Rube Goldberg solutions.  THey always present an unsolvable problem.

    Outlook has no online/offline status.  It connects periodically to get or send mail.  That is all.

    You can define a macro that sends a simple mail message every 5 minutes then have your own system alert you when the message fails to arrive.

    If you are on  Exchange then you should have Exchange forward the message for you.


    ¯\_(ツ)_/¯

    Friday, September 5, 2014 1:47 PM
  • I should also note that you cannot get a link to a remote application.  You can run a script on the server that can  attach locally.

    You would find it better to write a macro in Outlook that monitors the online status  (which will only show online if you are using Exchange direct and not SMTP.

    The VBA code can be looped to look for the connection and alert when it fails.

    It would make more sense to have Exchange forward the mail and dump the VM.


    ¯\_(ツ)_/¯

    • Proposed as answer by Mike Laughlin Friday, September 5, 2014 2:34 PM
    • Marked as answer by Just Karl Tuesday, June 2, 2015 10:37 PM
    Friday, September 5, 2014 2:13 PM
  • Even on Exchange the "Offline" flag never gets set if the network is disabled.  "Online" is a logical state which, once set, never changes.  You would need to attempt to send mail to determine if Outlook was connected.  That cannot be done from a VBScript without extra components.  It can be done from VBA.


    ¯\_(ツ)_/¯

    Friday, September 5, 2014 3:06 PM