none
How can I get the OOF status of a user without their password? RRS feed

All replies

  • The cmdlet Get-MailboxAutoReplyConfiguration will give you the users OOF.

    Martina Miskovic

    Tuesday, October 15, 2013 1:00 AM
  • Hi all;

    There is an example project to get a user's OOF status. However, it requires the user's password. I need a way to get it without having to know a user's password (I do NOT want to be storing passwords in my program).

    My program will be running on the same box Exchange is running on.

    How can I query any user's OOF?




    I agree with Martina.

    To get the OOF status of all user's mailbox in one shot on screen , Try :

    Get-mailbox -ResultSize unlimited|Get-MailboxAutoReplyConfiguration |Select identity,Autoreplystate,StartTime,EndTime

    To Export in a CSV file :

    Get-mailbox -ResultSize unlimited|Get-MailboxAutoReplyConfiguration |select identity,Autoreplystate,StartTime,EndTime |Export-Csv c:\OOFStatus.csv -NoTypeInformation


    MCITP - Exchange 2010 | MCITP - Windows Server 2008 R2

    Tuesday, October 15, 2013 3:24 AM
  • If you want do this with EWS (rather then the EMS as others have suggested) then you can use the OOF MailTip see http://gsexdev.blogspot.com.au/2011/11/using-mailtips-in-ews-to-get-oof-out-of.html . There are still no classes in the EWS Managed API to do this so you need to use either ProxyCode or Raw SOAP

    Cheers
    Glen

    Tuesday, October 15, 2013 4:28 AM
  • Thank you Martina/Tarique/Glen.

    I have two follow-on questions:

    1. Which of the two approaches will execute faster, EWS or EMS (or a 3rd way). I'm going to be calling this a lot so performance is critical.
    2. If it's the "Get-MailboxAutoReplyConfiguration" approach, how do I call that in my C# code (my transport agent DLL)?

    thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Tuesday, October 15, 2013 2:14 PM
  • If you didn't use AutoDiscover then EWS should be quicker as in EMS your going to have to open a Remote Powershell connection then execute the Cmdlet.

    I wouldn't use either of these in a Transport Agent (unless it was very low volume) as they are too heavy and inefficient operations in terms of time taken to execute which will restrict the throughput of any transport server and potentially affect mail delivery times. Ideally you want to query this from a In Memory cache or something simular to a RBL service.

    Cheers
    Glen

    Wednesday, October 16, 2013 6:03 AM
  • Hi Glen;

    Ideally you want to query this from a In Memory cache or something similar to a RBL service.

    Thank you for the suggestions. How can I query the info this way? Preferably the faster of the two as I will call this a lot (once per email).

    thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Wednesday, October 16, 2013 10:56 PM
  • Or...

    Is there a way I can get an event when the user changes their OOF status? That would be by far the best solution.

    ??? - thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Wednesday, October 16, 2013 11:47 PM
  • >> Is there a way I can get an event when the user changes their OOF status? That would be by far the best solution.

    There is no OOF event you can plug code into, however if you used EWS notifications on the Root (NON_IPM) of the Mailbox and then checked to see if its the IPM.Microsoft.OOF.UserOofSettings (oof logs) that caused the notification, that would be one way of doing it. Its much easier just to poll the status every 5 minutes if you don't need real time updates and even if you do use notification you generally want include polling in your notification code to ensure consistency.

    There is no off the shelf code for this so you'll need to engineer a solution. The one thing to be careful of is if your querying anything that's on another server if this isn't highly available you need to consider what happens to your agent when this isn't available because this will directly effect email delivery. One good example is an RBL service because this uses DNS it's easy to make highly available and DNS queries are really fast.

    Cheers
    Glen

    .

    Thursday, October 17, 2013 4:14 AM