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.
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.
For me Null didnt work. I left it empty to make it work.
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.
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 @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:
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.
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2