Gettting active directory username ( sAMAccountName)

%3CLINGO-SUB%20id%3D%22lingo-sub-1711807%22%20slang%3D%22en-US%22%3EGettting%20active%20directory%20username%20(%20sAMAccountName)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1711807%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20to%20get%20the%20active%20directory%20user%20name%20via%20API%20using%20the%20%22aadObjectId%22%20recevied%20the%20webhook%20.%20We%20can%20get%20the%20basic%20details%20using%20the%20API%26nbsp%3B3%2Fconversations%2F19%3Aja0cu120i1jod12j%40skype.net%2Fmembers%2Flabrown%40fabrikam.com%20as%20mentioned%20here%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fbots%2Fhow-to%2Fget-teams-context%3Ftabs%3Djson%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fbots%2Fhow-to%2Fget-teams-context%3Ftabs%3Djson%3C%2FA%3E%26nbsp%3B.%20I%20would%20like%20to%20get%20the%20username%20(sAMAccountName)%26nbsp%3B%20associated%20with%26nbsp%3B%20the%20%22aadObjectId%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThankyou%20for%20any%20help%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJijo%20John%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1711807%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1726320%22%20slang%3D%22en-US%22%3ERe%3A%20Gettting%20active%20directory%20username%20(%20sAMAccountName)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1726320%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%2F808600%22%20target%3D%22_blank%22%3E%40jijojohn%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENot%20sure%20if%20the%20following%20is%20of%20any%20use%20or%20just%20the%20Graph%20Documentation%20in%20general%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fresources%2Fuser%3Fview%3Dgraph-rest-1.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fresources%2Fuser%3Fview%3Dgraph-rest-1.0%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHenry%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hi 

 

Is there any way to get the active directory user name via API using the "aadObjectId" recevied the webhook . We can get the basic details using the API 3/conversations/19:ja0cu120i1jod12j@skype.net/members/labrown@fabrikam.com as mentioned here https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/get-teams-context?tabs=json . I would like to get the username (sAMAccountName)  associated with  the "aadObjectId".

 

Thankyou for any help

 

Jijo John

2 Replies
Highlighted

Hi @jijojohn ,

 

Not sure if the following is of any use or just the Graph Documentation in general:

 

https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0

 

Thanks

 

Henry

Highlighted

@jijojohn 

 

In fact my last reply might not be valid if this is On Prem AD, but I will leave it out there in case.

 

Thanks

 

Henry