Get Extension Attributes Using Microsoft Graph

There can be situations where you as a DevOps  engineer or infrastructure administrator want to access extension attributes or other onpremise attribute values from the cloud without accessing these thru on-premise infrastructure.

One such situation I have been encountered with Microsoft flow where I want to get back-end properties when user fill the powerapps form.

I can not get these properties using existing flow connectors like Office 365 users or Azure AD.

Looking at this problem what comes immediate in my mind is to utilize Microsoft Graph which can be used with flow, powerapps , powershell or any other methods, we just need to know the uri that needs to be used for fetching that information.

Launch Graph explorer:

https://developer.microsoft.com/en-us/graph/graph-explorer

Here is the uri to get the onpremise attributes information (note: onPremisesExtensionAttributes)

Update the ‘VikasSukhija@labtest.com’  –> with UserPrincipalName for which you want to extract these properties.


https://graph.microsoft.com/v1.0/users?$filter=startswith(userPrincipalName,'Vikas.Sukhija@labtest.com')&$select=id,displayname,mail,officeLocation,onPremisesExtensionAttributes

Now you know the graph uri for on-premise attributes and you have tested these with graph explorer.

You can now use these using powershell, flow, powerapps or any other method that you want.

Thanks for reading …..

Tech Wizard

https://techwizard.cloud

https://www.syscloudpro.com/

PowerShell Fast Track

Advertisement

4 thoughts on “Get Extension Attributes Using Microsoft Graph

  1. Hi!, great tip. Thank you. In my case the result the query runs but gets no result on the onPremisesExtensionAttributes attribute. Could this be due to a api permission ? I have User.All granted. Which permissions did you use?

  2. Hello ,

    Thank you for your blog @Vasil Michev , its really good one and very helpful.

    Is their any other string : signInActivity , If I need to use my onPrim AD attribute lastlogon , lastlogondate , Is this possible ?

    Thanks in advance.
    Nimit

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s