Graph API getting user initials and middlename

Yesterday I learnt about the profile resource type.

Gettting a user’s details via Graph, using the /me or /users/{id|UPN} endpoints (or via Get-MgUser) don’t return details like the Initials or Middle Name. That’s because these return the user resource type.

What you need instead, is to retrieve the profile resource type. That’s got via the /me/profile or /users/{id|UPN}/profile endpoints (or Get-MgUserProfile) which returns a much larger trove of information. (Thanks to).

I also learnt that I can do something like /users/{id|UPN}/profile/names just to get the Names info. I didn’t know one could do that with Graph API.

To just get Initials and (say) DisplayName, use the $select operator.

One learns new things every day!

As our circle of knowledge expands, so does the circumference of darkness surrounding it. – Albert Einstein