Use Power Automate to Extend Microsoft Endpoint Configuration Manager Application Approvals

Published Apr 15 2020 10:00 PM 5,089 Views
Microsoft

 

The native application approval functionality within Microsoft Endpoint Configuration Manager, or MECM (which is still often referred to as SCCM, ConfigMgr, and Configuration Manager) originally only allowed defined MECM admins to approve application requests from the Application Catalog and Software Center using the ConfigMgr/MECM administrator console. Beginning with ConfigMgr/MECM 1810, you could also begin making pre-approved machine based pre-approval requests devices with no user required, allowing you to install applications in real-time. Additionally, e-mails could be sent to a defined approver, or list of approvers for each application that is deployed by typing in e-mail addresses of approvers into each application deployment at deployment time. This feature is certainly coming along.

 

One thing that I often hear from customers is "I want to have my user's managers approve the applications, since they are going to ultimately be the ones responsible for covering the additional licensing costs out of their cost center." Unfortunately, you can only set one or more static e-mail address or DLs on each application deployment.  This isn't request isn't too feasible today without having someone receive the e-mails, look up the requester's manager, and manually forwarding them the ConfigMgr/MECM generated approval e-mail, or creating an Orchestrator runbook to accomplish the tasks.  

 

I've been diving head-first into any and every chance to create PowerApps and Power Automate (Flows) to harness the power of these ultra powerful low-code/no-code application creation, and automation platforms. This small feature gap in led me to the following idea which may suit the need for many who are waiting for the application approval functionality in the ConfigMgr/MECM product to further mature in the Application Approval feature.

 

First, I had my customer make and choose an "Application approval" e-mail account to use. All applications requiring approval would be set to automatically e-mail this mailbox any time an end-user requests an application from Software Center.

 

Next, I created a Flow (which you can download to import from here) using Microsoft Power Automate which is triggered each time a new e-mail is received by this account from the e-mail address that your ConfigMgr is sending application approvals from. An important thing to note on this, is when you set up the Outlook connections in the Flow, make sure you use this inbox rather than your own.  For each application which requires approval, set the application's approval e-mail within ConfigMgr to go to this e-mail account so that the flow is automatically triggered each time an approval comes in from ConfigMgr.  This Flow does not use any premium Power Automate connectors, so you can utilize these with the license included with an Office 365 subscription. The automatically generated e-mail from MECM / ConfigMgr looks like the following:

 

EmailSample.png

 

...and the Flow I came up with does the following:

 

1. The trigger for the flow is an e-mail coming into the created Application Approval account's inbox.  You could optionally add a subject filter of "application installation request" to prevent any other e-mails from coming into this box from triggering this flow unnecessarily.

beginningflowzoomed.png

2. Converts the received e-mail body from HTML to TEXT using the Content Conversion - HTML to TEXT (Preview) action which magically strips all HTML tags and headings from the body.

To further simplify getting to the interesting values I need to determine the submitting user's manager, I also removed all linefeed (LFs) using a Compose action with the expression. %0A is the ASCII code for a line feed, so I stripped them out by replacing them with nothing (by using two apostrophes and no space between them).

 

Note: By default, the convert HTML to text step will be called "HTML_to_text" so if you don't rename your step, be sure to change "Convert_Email_body_from_html_to_text" to "HTML_to_text".

 

uriComponentToString(replace(uriComponent(body('Convert_Email_body_from_html_to_text')), '%0A', ''))

 

3. Determine how many characters are in the user's DisplayName by using the first left parenthesis ("(") to subtract 10 characters from the total using the following expression:

 

Note: By default, a new "Compose" step will be named "Compose" so if you didn't rename your first Compose step, be sure to change "Remove_Linefeeds" to "Compose" here, or whatever else you renamed it to.  Spaces in the name need to be replaced with underlines in an expression, so be aware of that also.

 

add(int(indexOf(outputs('Remove_Linefeeds'), '(')), -10)

 

This expression will get the index of the first left parenthesis '(' and subtract 10 from it.  This will get us to the beginning of the user's display name.  It uses the resulting indexOf values to get the user's DisplayName attribute from Azure AD (synced via Azure AD Connect), which begins at the index (character) number 9 of the resulting string output from the "Remove Linefeeds" action, and ends at at the index of the dash after the user's DisplayName.

 

Note: By default, a new "Compose" step will be named "Compose" so if you don't rename your previous steps, be sure to change "Remove_Linefeeds" to "Compose" here so it knows which step to use.

 

I did this using the following expression:

 

substring(outputs('Remove_Linefeeds'), 9,outputs('Index_of_left_parens'))

 

4. Uses the DisplayName to grab the user's e-mail address ("Mail" property) using the Office365 Users connector's "Search for users" flow action.  You'll need to use the output from the previous "DisplayName" action, which should now be equal to the display name of the user - ex: "John Doe".  You can validate this by running the flow and looking at the results of the run to make sure it looks right, and that it finds the correct user.

 

5. Uses the user's "Mail" property from the previous step to look up the user's manager (the manager is typically automatically already syncing if you're using Azure AD Connect) using the Office 365 Users connector.

 

6. Forwards the e-mail automatically sent by the application approval request feature to the user's manager.

 

The user's manager will receive the e-mail and can determine whether to approve or deny the request, and whichever link they click will work. If the user is authenticated via Azure AD and you have Cloud Management Gateway (CMG) enabled along with enabling the new Admin Service feature of the SMS provider, the manager can also approve the requests when connected to the Internet by way of CMG. Nice!

 

Here's the full Flow:

 

flow.png

 

Here's a zoomed version of the last two steps which gets the user's manager and forwards the e-mail to them:

 

endflowzoomed.png

 

The automatically generated e-mails sent from ConfigMgr/MECM when an application approval request is submitted by an end user is formatted in a predictable way. If it's changed in a future version, these flows may need adjusted to match, depending on what changes. Once the HTML and LineFeeds are removed, the whole e-mail is on one nice long string on a single line. I felt this would be much easier to get to the important stuff!

 

You could also optionally log some or all of the interesting values from the e-mail to a Sharepoint list, Excel spreadsheet, or whatever your heart desires to keep track of the requests outside of ConfigMgr/MECM.

 

Enjoy!

5 Comments
%3CLINGO-SUB%20id%3D%22lingo-sub-1315786%22%20slang%3D%22en-US%22%3ERe%3A%20Use%20Power%20Automate%20to%20Extend%20Microsoft%20Endpoint%20Manager%20Application%20Approvals%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1315786%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20is%20a%20great%20step%20towards%20approval%20hand-off%20to%20managers%20instead%20of%20IT%20admins!%20I'm%20brand%20new%20to%20Flow%20and%20PowerAutomate%20and%20would%20like%20to%20give%20your%20post%20a%20try.%20Do%20you%20have%20some%20extra%20info%20or%20guide%20to%20how%20you%20went%20about%20setting%20up%20the%20Flow%20itself%3F%20Thanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1322057%22%20slang%3D%22en-US%22%3ERe%3A%20Use%20Power%20Automate%20to%20Extend%20Microsoft%20Endpoint%20Manager%20Application%20Approvals%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1322057%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F307269%22%20target%3D%22_blank%22%3E%40neekr%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3ECreate%20a%20new%20Automated%20Flow.%3C%2FP%3E%0A%3CP%3EAdd%20the%20%22When%20a%20new%20email%20arrives%22%20trigger%20(the%20V2%20or%20V3%20version%20of%20this%20is%20fine%20also).%26nbsp%3B%20You%20should%20set%20the%20applications%20needing%20approval%20to%20arrive%20in%20the%20Inbox%20you%20choose%2C%20and%20set%20the%20Subject%20to%20match%20the%20subject%20that%20the%20e-mails%20come%20in%20from%20ConfigMgr%20as%20so%20it%20only%20acts%20on%20those%20e-mails.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAdd%20the%20%22HTML%20to%20Text%22%20action%3C%2FP%3E%0A%3CP%3EAdd%20the%20%22Body%22%20dynamic%20content%20output%20from%20the%20%22When%20a%20new%20email%20arrives%22%20step%20to%20the%20%22Content%22%20field%20on%20the%20%22HTML%20to%20Text%22%20action%20step.%3C%2FP%3E%0A%3CP%3ENext%2C%20Add%203%20new%20Data%20Operation%2FCompose%20steps%3C%2FP%3E%0A%3CP%3EOn%20the%20first%20one%2C%20rename%20it%20to%20%22Remove%20Linefeeds%22%2C%20click%20%22Expression%22%20and%20paste%20in%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EuriComponentToString(replace(uriComponent(body('Convert_Email_body_from_html_to_text'))%2C%20'%250A'%2C%20''))%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EOn%20the%20second%20one%2C%20rename%20it%20to%20%22Index%20of%20dash%22%2C%20click%20%22Expression%22%20and%20paste%20in%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Eadd(int(indexOf(outputs('Remove_Linefeeds')%2C%20'%20-'))%2C%20-10)%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20the%20third%20one%2C%20rename%20it%20to%20%22DisplayName%22%2C%20click%20%22Expression%22%20and%20paste%20in%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Esubstring(outputs('Remove_Linefeeds')%2C%209%2Coutputs('Index_of_dash'))%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAdd%20an%20Office%20365%20Users%20%22%3CSTRONG%3ESearch%20for%20users%20(V2%3C%2FSTRONG%3E)%22%20step%20and%20use%20%22%3CSTRONG%3EDisplayName%3C%2FSTRONG%3E%22%20for%20its%20input.%3C%2FP%3E%0A%3CP%3EAdd%20an%20Office%20365%20Users%20%22%3CSTRONG%3EGet%20Manager%20(V2)%3C%2FSTRONG%3E%22%20step%20and%20use%20the%20output%20of%20the%20Search%20for%20user%20(V2)%20step%3C%2FP%3E%0A%3CP%3EAdd%20an%20Office%20365%20Outlook%20%22%3CSTRONG%3EForward%20an%20email%20(V2)%3C%2FSTRONG%3E%22%20step%20and%20select%20the%20%22%3CSTRONG%3EMessage%20Id%3C%2FSTRONG%3E%22%20Dynamic%20Content%20from%20the%20original%20e-mail%20output%2C%20and%20the%20%22%3CSTRONG%3EMail%3C%2FSTRONG%3E%22%20Dynamic%20Content%20from%20the%20%22%3CSTRONG%3EGet%20Manager%20(V2)%20step%3C%2FSTRONG%3E%22.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%20me%20know%20if%20you%20get%20stuck.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1289220%22%20slang%3D%22en-US%22%3EUse%20Power%20Automate%20to%20Extend%20Microsoft%20Endpoint%20Configuration%20Manager%20Application%20Approvals%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1289220%22%20slang%3D%22en-US%22%3E%3CH1%20id%3D%22toc-hId-438726628%22%20id%3D%22toc-hId-438726628%22%20id%3D%22toc-hId-438726628%22%20id%3D%22toc-hId-438726628%22%20id%3D%22toc-hId-438726628%22%20id%3D%22toc-hId-438726628%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CP%3EThe%20native%20application%20approval%20functionality%20within%20Microsoft%20Endpoint%20Configuration%20Manager%2C%20or%20MECM%20(which%20is%20still%20often%20referred%20to%20as%20SCCM%2C%20ConfigMgr%2C%20and%20Configuration%20Manager)%20originally%20only%20allowed%20defined%20MECM%20admins%20to%20approve%20application%20requests%20from%20the%20Application%20Catalog%20and%20Software%20Center%20using%20the%20ConfigMgr%2FMECM%20administrator%20console.%20Beginning%20with%20ConfigMgr%2FMECM%201810%2C%20you%20could%20also%20begin%20making%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fconfiguration-manager-blog%2Fapplication-approval-improvements-in-configmgr-1810%2Fba-p%2F303534%22%20target%3D%22_blank%22%3Epre-approved%20machine%20based%20pre-approval%20requests%20devices%3C%2FA%3E%20with%20no%20user%20required%2C%20allowing%20you%20to%20install%20applications%20in%20real-time.%20Additionally%2C%20e-mails%20could%20be%20sent%20to%20a%20defined%20approver%2C%20or%20list%20of%20approvers%20for%20each%20application%20that%20is%20deployed%20by%20typing%20in%20e-mail%20addresses%20of%20approvers%20into%20each%20application%20deployment%20at%20deployment%20time.%20This%20feature%20is%20certainly%20coming%20along.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20thing%20that%20I%20often%20hear%20from%20customers%20is%20%22I%20want%20to%20have%20my%20user's%20managers%20approve%20the%20applications%2C%20since%20they%20are%20going%20to%20ultimately%20be%20the%20ones%20responsible%20for%20covering%20the%20additional%20licensing%20costs%20out%20of%20their%20cost%20center.%22%20Unfortunately%2C%20you%20can%20only%20set%20one%20or%20more%20static%20e-mail%20address%20or%20DLs%20on%20each%20application%20deployment.%26nbsp%3B%20This%20isn't%20request%20isn't%20too%20feasible%20today%20without%20having%20someone%20receive%20the%20e-mails%2C%20look%20up%20the%20requester's%20manager%2C%20and%20manually%20forwarding%20them%20the%20ConfigMgr%2FMECM%20generated%20approval%20e-mail%2C%20or%20creating%20an%20Orchestrator%20runbook%20to%20accomplish%20the%20tasks.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI've%20been%20diving%20head-first%20into%20any%20and%20every%20chance%20to%20create%20PowerApps%20and%20Power%20Automate%20(Flows)%20to%20harness%20the%20power%20of%20these%20ultra%20powerful%20low-code%2Fno-code%20application%20creation%2C%20and%20automation%20platforms.%20This%20small%20feature%20gap%20in%20led%20me%20to%20the%20following%20idea%20which%20may%20suit%20the%20need%20for%20many%20who%20are%20waiting%20for%20the%20application%20approval%20functionality%20in%20the%20ConfigMgr%2FMECM%20product%20to%20further%20mature%20in%20the%20Application%20Approval%20feature.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFirst%2C%20I%20had%20my%20customer%20make%20and%20choose%20an%20%22Application%20approval%22%20e-mail%20account%20to%20use.%20All%20applications%20requiring%20approval%20would%20be%20set%20to%20automatically%20e-mail%20this%20mailbox%20any%20time%20an%20end-user%20requests%20an%20application%20from%20Software%20Center.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENext%2C%20I%20created%20a%20Flow%20using%20Microsoft%20Power%20Automate%20which%20is%20triggered%20each%20time%20a%20new%20e-mail%20is%20received%20by%20this%20account%20from%20the%20e-mail%20address%20that%20your%20ConfigMgr%20is%20sending%20application%20approvals%20from.%20For%20each%20application%20which%20requires%20approval%2C%20set%20the%20approval%20to%20go%20to%20this%20e-mail%20account%20so%20that%20the%20flow%20is%20automatically%20triggered%20each%20time%20an%20approval%20comes%20in%20from%20ConfigMgr.%26nbsp%3B%20This%20Flow%20does%20not%20use%20any%20premium%20Power%20Automate%20connectors%2C%20so%20you%20can%20utilize%20these%20with%20the%20license%20included%20with%20an%20Office%20365%20subscription.%20The%20automatically%20generated%20e-mail%20from%20MECM%20%2F%20ConfigMgr%20looks%20like%20the%20following%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorRuss%20Rimmerman_8%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image001.png%22%20style%3D%22width%3A%20684px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182865i5910A2B7F8158297%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image001.png%22%20alt%3D%22Automated%20E-mail%20from%20MEM%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EAutomated%20E-mail%20from%20MEM%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E...and%20the%20Flow%20I%20came%20up%20with%20does%20the%20following%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20Converts%20the%20received%20e-mail%20body%20from%20HTML%20to%20TEXT%20using%20the%20%3CSTRONG%3EContent%20Conversion%20-%20HTML%20to%20TEXT%20(Preview)%3C%2FSTRONG%3E%20action%20which%20magically%20strips%20all%20HTML%20tags%20and%20headings%20from%20the%20body.%3C%2FP%3E%0A%3CP%3ETo%20further%20simplify%20getting%20to%20the%20interesting%20values%20I%20need%20to%20determine%20the%20submitting%20user's%20manager%2C%20I%20also%20removed%20all%20linefeed%20(LFs)%20using%20a%20%3CSTRONG%3ECompose%20%3C%2FSTRONG%3Eaction%20with%20the%20expression.%20%3CSTRONG%3E%250A%3C%2FSTRONG%3E%20is%20the%20ASCII%20code%20for%20a%20line%20feed%2C%20so%20I%20stripped%20them%20out%20by%20replacing%20them%20with%20nothing%20(by%20using%20two%20apostrophes%20and%20no%20space%20between%20them).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENote%3A%20By%20default%2C%20the%20remove%20HTML%20step%20will%20be%20called%20%22HTML_to_text%22%20so%20if%20you%20don't%20rename%20your%20step%2C%20be%20sure%20to%20change%20%22Convert_Email_body_from_html_to_text%22%20to%20%22HTML_to_text%22.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EuriComponentToString(replace(uriComponent(body('Convert_Email_body_from_html_to_text'))%2C%20'%250A'%2C%20''))%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%20Determines%20how%20many%20characters%20are%20in%20the%20user's%20DisplayName%20by%20using%20the%20dash%20(%22-%22)%20to%20subtract%2010%20characters%20from%20the%20total%20using%20the%20following%20expression%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENote%3A%20By%20default%2C%20a%20new%20%22Compose%22%20step%20will%20be%20named%20%22Compose%22%20so%20if%20you%20didn't%20rename%20your%20first%20Compose%20step%2C%20be%20sure%20to%20change%20%22Remove_Linefeeds%22%20to%20%22Compose%22%20here%2C%20or%20whatever%20else%20you%20renamed%20it%20to.%26nbsp%3B%20Spaces%20in%20the%20name%20need%20to%20be%20replaced%20with%20underlines%20in%20an%20expression%2C%20so%20be%20aware%20of%20that%20also.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Eadd(int(indexOf(outputs('Remove_Linefeeds')%2C%20'%20-'))%2C%20-10)%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20realized%20I%20needed%20to%20be%20careful%20with%20this%2C%20as%20some%20ladies%20use%20a%20dash%20in%20their%20last%20name%20to%20indicate%20they're%20keeping%20both%20their%20maiden%20and%20married%20names.%20This%20is%20the%20reason%20I%20added%20a%20space%20after%20the%20'%20and%20before%20the%20-%20so%20it%E2%80%99s%20'%20-'%20rather%20than%20'-'%20so%20it%20will%20always%20skip%20over%20any%20dashes%20that%20occur%20in%20their%20last%20name%20since%20they%20don't%20have%20spaces.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3.%20Uses%20the%20above%20values%20to%20get%20the%20user's%20DisplayName%20attribute%20from%20Azure%20AD%20(synced%20via%20Azure%20AD%20Connect)%2C%20which%20begins%20at%20the%20index%20(character)%20number%209%20of%20the%20resulting%20string%20output%20from%20the%20%22Remove%20Linefeeds%22%20action%2C%20and%20ends%20at%20at%20the%20index%20of%20the%20dash%20after%20the%20user's%20DisplayName.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENote%3A%20By%20default%2C%20a%20new%20%22Compose%22%20step%20will%20be%20named%20%22Compose%22%20so%20if%20you%20don't%20rename%20your%20previous%20steps%2C%20be%20sure%20to%20change%20%22Remove_Linefeeds%22%20to%20%22Compose%22%20here.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20did%20this%20using%20the%20following%20expression%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Esubstring(outputs('Remove_Linefeeds')%2C%209%2Coutputs('Index_of_dash'))%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E4.%20Uses%20the%20DisplayName%20to%20grab%20the%20user's%20e-mail%20address%20(%22Mail%22%20property)%20using%20the%20Office365%20Users%20connector's%20%22Search%20for%20users%22%20flow%20action.%26nbsp%3B%20You'll%20need%20to%20use%20the%20output%20from%20the%20previous%20%22DisplayName%22%20action%2C%20which%20should%20now%20be%20equal%20to%20the%20display%20name%20of%20the%20user%20-%20ex%3A%20%22John%20Doe%22.%26nbsp%3B%20You%20can%20validate%20this%20by%20running%20the%20flow%20and%20looking%20at%20the%20results%20of%20the%20run%20to%20make%20sure%20it%20looks%20right%2C%20and%20that%20it%20finds%20the%20correct%20user.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E5.%20Uses%20the%20user's%20%22Mail%22%20property%20from%20the%20previous%20step%20to%20look%20up%20the%20user's%20manager%20(the%20manager%20is%20typically%20automatically%20already%20syncing%20if%20you're%20using%20Azure%20AD%20Connect)%20using%20the%20Office%20365%20Users%20connector.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E6.%20Forwards%20the%20e-mail%20automatically%20sent%20by%20the%20application%20approval%20request%20feature%20to%20the%20user's%20manager.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20user's%20manager%20will%20receive%20the%20e-mail%20and%20can%20determine%20whether%20to%20approve%20or%20deny%20the%20request%2C%20and%20whichever%20link%20they%20click%20will%20work.%20If%20the%20user%20is%20authenticated%20via%20Azure%20AD%20and%20you%20have%20Cloud%20Management%20Gateway%20(CMG)%20enabled%20along%20with%20enabling%20the%20new%20Admin%20Service%20feature%20of%20the%20SMS%20provider%2C%20the%20manager%20can%20also%20approve%20the%20requests%20when%20connected%20to%20the%20Internet%20by%20way%20of%20CMG.%26nbsp%3B%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3ENice!%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere's%20the%20full%20Flow%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorRuss%20Rimmerman_9%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%20style%3D%22%20text-align%3A%20center%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image003.png%22%20style%3D%22width%3A%20528px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182848i2207B8F048676641%2Fimage-dimensions%2F528x983%3Fv%3D1.0%22%20width%3D%22528%22%20height%3D%22983%22%20title%3D%22image003.png%22%20alt%3D%22Full%20Flow%20end-to-end%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFull%20Flow%20end-to-end%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere's%20a%20zoomed%20version%20of%20the%20last%20two%20steps%20which%20gets%20the%20user's%20manager%20and%20forwards%20the%20e-mail%20to%20them%3A%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%3A%20center%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%3A%20center%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image004.png%22%20style%3D%22width%3A%20604px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F182853i80E164B691E6AEC8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image004.png%22%20alt%3D%22Details%20of%20the%20%26quot%3BGet%20users%20manager%26quot%3B%20and%20the%20forward%20e-mail%20actions.%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EDetails%20of%20the%20%22Get%20users%20manager%22%20and%20the%20forward%20e-mail%20actions.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20text-align%3A%20center%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20automatically%20generated%20e-mails%20sent%20from%20ConfigMgr%2FMECM%20when%20an%20application%20approval%20request%20is%20submitted%20by%20an%20end%20user%20is%20formatted%20in%20a%20predictable%20way.%20If%20it's%20changed%20in%20a%20future%20version%2C%20these%20flows%20may%20need%20adjusted%20to%20match%2C%20depending%20on%20what%20changes.%20Once%20the%20HTML%20and%20LineFeeds%20are%20removed%2C%20the%20whole%20e-mail%20is%20on%20one%20nice%20long%20string%20on%20a%20single%20line.%20I%20felt%20this%20would%20be%20much%20easier%20to%20get%20to%20the%20important%20stuff!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20could%20also%20optionally%20log%20some%20or%20all%20of%20the%20interesting%20values%20from%20the%20e-mail%20to%20a%20Sharepoint%20list%2C%20Excel%20spreadsheet%2C%20or%20whatever%20your%20heart%20desires%20to%20keep%20track%20of%20the%20requests%20outside%20of%20ConfigMgr%2FMECM.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEnjoy!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1289220%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20native%20application%20approval%20functionality%20within%20Microsoft%20Endpoint%20Configuration%20Manager%20originally%20only%20allowed%20defined%20admins%20to%20approve%20application%20requests%20from%20the%20Application%20Catalog%20and%20Software%20Center%20using%20the%20administrator%20console.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1289220%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ERussRimmerman%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1404776%22%20slang%3D%22en-US%22%3ERe%3A%20Use%20Power%20Automate%20to%20Extend%20Microsoft%20Endpoint%20Configuration%20Manager%20Application%20Approvals%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1404776%22%20slang%3D%22en-US%22%3E%3CP%3EFound%20what%20I%20was%20doing%20wrong..%20Please%20ignore%20this.%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E-ERR%3AREF-NOT-FOUND-%40Russ%20Rimmerman%26nbsp%3BThis%20is%20really%20great%20post.%3C%2FP%3E%3CP%3EI%20am%20trying%20this%20out%20but%20it's%20failing%20at%20%22DisplayName%22%20step%20with%20below%20error%3A%20%22Unable%20to%20process%20template%20language%20expressions%20in%20action%20'DisplayName'%20inputs%20at%20line%20'1'%20and%20column%20'2796'%3A%20'The%20template%20language%20function%20'substring'%20parameters%20are%20out%20of%20range%3A%20'start%20index'%20and%20'length'%20must%20be%20non-negative%20integers%20and%20their%20sum%20must%20be%20no%20larger%20than%20the%20length%20of%20the%20string.%20Please%20see%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F237860%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Faka.ms%2Flogicexpressions%23substring%3C%2FA%3E%20for%20usage%20details.'.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOutput%20for%20Remove_Linefeeds%3A%20%22Hi%20there%2CUsername%20%5BUserID%5D%20(Domain%5CUserID)%20wants%20to%20install%20Applicationname%20on%20the%20device%20titled%20Hostname.User's%20comments%3APlease%20approve.Please%20click%20one%20of%20the%20buttons%20below%20to%20approve%20or%20deny%20this%20request.Approve%5BHTTPS%3A%2F%2FSiteServerFQDN%2FAdminService%2Fv1.0%2FUserApplicationRequest%2FAdminService.ApproveRequest(Guid%3D'xyz')%5DDeny%5BHTTPS%3A%2F%2FSiteServerFQDN%2FAdminService%2Fv1.0%2FUserApplicationRequest%2FAdminService.DenyRequest(Guid%3D'xyz)%5DNote%3A%20these%20links%20only%20work%20when%20connected%20to%20your%20internal%20network.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOutput%20for%20%22Index_of_dash%22%3A%26nbsp%3B%20-11%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20something%20I%20am%20doing%20wrong%3F%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1475852%22%20slang%3D%22en-US%22%3ERe%3A%20Use%20Power%20Automate%20to%20Extend%20Microsoft%20Endpoint%20Configuration%20Manager%20Application%20Approvals%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1475852%22%20slang%3D%22en-US%22%3E%3CDIV%20class%3D%22fl-LabeledText%22%3E%3CDIV%20class%3D%22fl-LabeledText-label%22%3EI%20receive%20a%20similar%20error%20as%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F673741%22%20target%3D%22_blank%22%3E%40mudit365%3C%2FA%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22fl-LabeledText-text%22%3EAction%20'DisplayName'%20failed%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22ms-TextField%20ms-TextField--multiline%20fl-TextField%20root-601%22%3E%3CDIV%20class%3D%22ms-TextField-wrapper%20wrapper-602%22%3EError%20Details%3C%2FDIV%3E%3CDIV%20class%3D%22ms-TextField-wrapper%20wrapper-602%22%3EUnable%20to%20process%20template%20language%20expressions%20in%20action%20'DisplayName'%20inputs%20at%20line%20'1'%20and%20column%20'2876'%3A%20'The%20template%20language%20function%20'substring'%20parameters%20are%20out%20of%20range%3A%20'start%20index'%20and%20'length'%20must%20be%20non-negative%20integers%20and%20their%20sum%20must%20be%20no%20larger%20than%20the%20length%20of%20the%20string.%20Please%20see%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Flogicexpressions%23substring%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Faka.ms%2Flogicexpressions%23substring%3C%2FA%3E%20for%20usage%20details.'.%3C%2FDIV%3E%3CDIV%20class%3D%22ms-TextField-wrapper%20wrapper-602%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22ms-TextField-wrapper%20wrapper-602%22%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3Esubstring(outputs(%3C%2FSPAN%3E%3CSPAN%3E'Remove_Linefeeds'%3C%2FSPAN%3E%3CSPAN%3E)%2C%26nbsp%3B9%2Coutputs(%3C%2FSPAN%3E%3CSPAN%3E'Index_of_dash'%3C%2FSPAN%3E%3CSPAN%3E))%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Elove%20the%20automation.%20Thanks%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1625957%22%20slang%3D%22en-US%22%3ERe%3A%20Use%20Power%20Automate%20to%20Extend%20Microsoft%20Endpoint%20Configuration%20Manager%20Application%20Approvals%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1625957%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F165215%22%20target%3D%22_blank%22%3E%40Roy%20Branch%3C%2FA%3E%26nbsp%3Bdid%20you%20get%20it%20figured%20out%3F%26nbsp%3B%20If%20not%2C%20can%20you%20send%20a%20screenshot%20of%20your%20Flow%20or%20e-mail%20it%20to%20rurimmer%40microsoft.com%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Co-Authors
Version history
Last update:
‎Nov 11 2021 07:35 AM
Updated by: