cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
u4jaanus
Resolver I
Resolver I

Automate to Check if Autoreply Enabled (Not Configured)

Hi,

Trying to update a list of available employee's by checking if they have Autoreply enabled or not. I understand we can use Get mail tips for a mailbox v2 but this only tells if autoreply is configured or not- not enabled or not. Mostly users have configured their auto reply for a previous occasion not necessarily indicates that the user is out of office.. hence want to know if we can retrieve information related to autoreply enabled.. i.e. - Get-MailBoxAutoReplyConfiguration.

3 ACCEPTED SOLUTIONS

Accepted Solutions
ekarim2020
Super User
Super User

Hi @u4jaanus ,

 

I ran the Get Mail Tips for all mailbox (V2) for all users on my tenant.

I observed that user who don't have automatic replies enabled, the message property is empty:

 

[
  {
    "mailboxFull": false,
    "externalMemberCount": 0,
    "totalMemberCount": 1,
    "deliveryRestricted": false,
    "isModerated": false,
    "maxMessageSize": 37748736,
    "emailAddress": {
      "name": "",
      "address": "user@email.com"
    },
    "automaticReplies": {
      "message": ""
    }
  }
]

 

I also observed that users who have automatic replies enabled, the message property contains text:

 

[
  {
    "mailboxFull": false,
    "externalMemberCount": 0,
    "totalMemberCount": 1,
    "deliveryRestricted": false,
    "isModerated": false,
    "maxMessageSize": 37748736,
    "emailAddress": {
      "name": "",
      "address": "user1@email.com"
    },
    "automaticReplies": {
      "message": "I'm out of the office ...."
    }
  }
]

 

And those users who have automatic replies enabled, some have set a scheduled start and end time:

 

[
  {
    "mailboxFull": false,
    "externalMemberCount": 0,
    "totalMemberCount": 1,
    "deliveryRestricted": false,
    "isModerated": false,
    "maxMessageSize": 37748736,
    "emailAddress": {
      "name": "",
      "address": "user2@email.com"
    },
    "automaticReplies": {
      "message": "I'm out of the office ....",
      "scheduledStartTime": {
        "dateTime": "2022-04-14T16:00:00.0000000",
        "timeZone": "UTC"
      },
      "scheduledEndTime": {
        "dateTime": "2022-05-04T08:30:00.0000000",
        "timeZone": "UTC"
      }
    }
  }
]

 

I checked if the message property contained text:

Snag_dc8b3a.png

The expression I used in the Condition to reference the message property: 

 

outputs('Get_mail_tips_for_a_mailbox_(V2)')?['body/value']?[0]?['automaticReplies/message']

 

For more info on this, see video:  Detecting Out of Office Recipients using Power Automate

 

Hope this helps.


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

CraigStewart
Resolver III
Resolver III

Just popping on to say that on the condition I had to add null as an expression for this to work rather than leave it blank.

View solution in original post

Update: Thanks Ellis for directing me towards the correct path. Wanted to update the post so others could get help.

In Auto reply there can be Four scenarios and each scenario will return a different format when "Get Mail Tips for all mailbox (V2)" is used.

1st Scenario as you mentioned above "who don't have automatic replies enabled, the message property is empty:"

 

[
  {
    "mailboxFull": false,
    "externalMemberCount": 0,
    "totalMemberCount": 1,
    "deliveryRestricted": false,
    "isModerated": false,
    "maxMessageSize": 37748736,
    "emailAddress": {
      "name": "",
      "address": "user@email.com"
    },
    "automaticReplies": {
      "message": ""
    }
  }
]

 

2nd Scenario as your mentioned above "users who have automatic replies enabled, the message property contains text:"

 

[
  {
    "mailboxFull": false,
    "externalMemberCount": 0,
    "totalMemberCount": 1,
    "deliveryRestricted": false,
    "isModerated": false,
    "maxMessageSize": 37748736,
    "emailAddress": {
      "name": "",
      "address": "user1@email.com"
    },
    "automaticReplies": {
      "message": "I'm out of the office ...."
    }
  }
]

 

3rd Scenario as you mentioned above "who have automatic replies enabled, some have set a scheduled start and end time:"

 

[
  {
    "mailboxFull": false,
    "externalMemberCount": 0,
    "totalMemberCount": 1,
    "deliveryRestricted": false,
    "isModerated": false,
    "maxMessageSize": 37748736,
    "emailAddress": {
      "name": "",
      "address": "user2@email.com"
    },
    "automaticReplies": {
      "message": "I'm out of the office ....",
      "scheduledStartTime": {
        "dateTime": "2022-04-14T16:00:00.0000000",
        "timeZone": "UTC"
      },
      "scheduledEndTime": {
        "dateTime": "2022-05-04T08:30:00.0000000",
        "timeZone": "UTC"
      }
    }
  }
]

 

The Fourth Scenario is when User have auto reply message set but autoreply is not active. i.e. previously an auto reply was active but then was disabled. this will return an empty object i.e. "automaticReplies": {}. 

I tried using condition to check if the output is 0 but was having the issues as {} is not 0 hence i was getting it wrong. 

I used empty() function with target to "automaticReplies/messages" if true means user is in office and false means user is out of office.

Hope this help others.

View solution in original post

5 REPLIES 5
ekarim2020
Super User
Super User

Hi @u4jaanus ,

 

I ran the Get Mail Tips for all mailbox (V2) for all users on my tenant.

I observed that user who don't have automatic replies enabled, the message property is empty:

 

[
  {
    "mailboxFull": false,
    "externalMemberCount": 0,
    "totalMemberCount": 1,
    "deliveryRestricted": false,
    "isModerated": false,
    "maxMessageSize": 37748736,
    "emailAddress": {
      "name": "",
      "address": "user@email.com"
    },
    "automaticReplies": {
      "message": ""
    }
  }
]

 

I also observed that users who have automatic replies enabled, the message property contains text:

 

[
  {
    "mailboxFull": false,
    "externalMemberCount": 0,
    "totalMemberCount": 1,
    "deliveryRestricted": false,
    "isModerated": false,
    "maxMessageSize": 37748736,
    "emailAddress": {
      "name": "",
      "address": "user1@email.com"
    },
    "automaticReplies": {
      "message": "I'm out of the office ...."
    }
  }
]

 

And those users who have automatic replies enabled, some have set a scheduled start and end time:

 

[
  {
    "mailboxFull": false,
    "externalMemberCount": 0,
    "totalMemberCount": 1,
    "deliveryRestricted": false,
    "isModerated": false,
    "maxMessageSize": 37748736,
    "emailAddress": {
      "name": "",
      "address": "user2@email.com"
    },
    "automaticReplies": {
      "message": "I'm out of the office ....",
      "scheduledStartTime": {
        "dateTime": "2022-04-14T16:00:00.0000000",
        "timeZone": "UTC"
      },
      "scheduledEndTime": {
        "dateTime": "2022-05-04T08:30:00.0000000",
        "timeZone": "UTC"
      }
    }
  }
]

 

I checked if the message property contained text:

Snag_dc8b3a.png

The expression I used in the Condition to reference the message property: 

 

outputs('Get_mail_tips_for_a_mailbox_(V2)')?['body/value']?[0]?['automaticReplies/message']

 

For more info on this, see video:  Detecting Out of Office Recipients using Power Automate

 

Hope this helps.


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

CraigStewart
Resolver III
Resolver III

Just popping on to say that on the condition I had to add null as an expression for this to work rather than leave it blank.

Hi Ellis, 

Actually you are right; when I was checking yesterday; the user I was checking was out of office hence was getting values in Message caused me confusion if I am using it correctly or not. Today i tested different users and Yes message tag is empty if Out Of Office is not set. 

For me Null didnt work. I left it empty to make it work.

Update: Thanks Ellis for directing me towards the correct path. Wanted to update the post so others could get help.

In Auto reply there can be Four scenarios and each scenario will return a different format when "Get Mail Tips for all mailbox (V2)" is used.

1st Scenario as you mentioned above "who don't have automatic replies enabled, the message property is empty:"

 

[
  {
    "mailboxFull": false,
    "externalMemberCount": 0,
    "totalMemberCount": 1,
    "deliveryRestricted": false,
    "isModerated": false,
    "maxMessageSize": 37748736,
    "emailAddress": {
      "name": "",
      "address": "user@email.com"
    },
    "automaticReplies": {
      "message": ""
    }
  }
]

 

2nd Scenario as your mentioned above "users who have automatic replies enabled, the message property contains text:"

 

[
  {
    "mailboxFull": false,
    "externalMemberCount": 0,
    "totalMemberCount": 1,
    "deliveryRestricted": false,
    "isModerated": false,
    "maxMessageSize": 37748736,
    "emailAddress": {
      "name": "",
      "address": "user1@email.com"
    },
    "automaticReplies": {
      "message": "I'm out of the office ...."
    }
  }
]

 

3rd Scenario as you mentioned above "who have automatic replies enabled, some have set a scheduled start and end time:"

 

[
  {
    "mailboxFull": false,
    "externalMemberCount": 0,
    "totalMemberCount": 1,
    "deliveryRestricted": false,
    "isModerated": false,
    "maxMessageSize": 37748736,
    "emailAddress": {
      "name": "",
      "address": "user2@email.com"
    },
    "automaticReplies": {
      "message": "I'm out of the office ....",
      "scheduledStartTime": {
        "dateTime": "2022-04-14T16:00:00.0000000",
        "timeZone": "UTC"
      },
      "scheduledEndTime": {
        "dateTime": "2022-05-04T08:30:00.0000000",
        "timeZone": "UTC"
      }
    }
  }
]

 

The Fourth Scenario is when User have auto reply message set but autoreply is not active. i.e. previously an auto reply was active but then was disabled. this will return an empty object i.e. "automaticReplies": {}. 

I tried using condition to check if the output is 0 but was having the issues as {} is not 0 hence i was getting it wrong. 

I used empty() function with target to "automaticReplies/messages" if true means user is in office and false means user is out of office.

Hope this help others.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,023)