question

DannyBanda-2139 avatar image
0 Votes"
DannyBanda-2139 asked DannyBanda-2139 answered

CM - Azure AD Discovery ERROR: Error occurred. StatusCode = Unauthorized, reason = Unauthorized

Configuring Azure services from CM, when try to do a Discovery the task failed with the following error:

Successfully acquired access token for server app.

Making Graph request https://graph.windows.net/e349f320-0c86-4b66-aa08-7d55530d25d8/users?api-version=1.6&$filter=isof('Microsoft.DirectoryServices.User')&$select=objectId,userPrincipalName,onPremisesSecurityIdentifier,displayName,mailNickname,mail&deltaLink=&ocp-aad-dq-include-only-delta-token=true

ERROR: Error occurred. StatusCode = Unauthorized, reason = Unauthorized
ERROR: Sync request failed. Error: System.Net.WebException: Unauthorized: Unauthorized~~ at

Microsoft.ConfigurationManager.AzureADDiscovery.AzureADQueryClient.GetGraphResponse(String graphRequest)~~ at Microsoft.ConfigurationManager.AzureADDiscovery.AzureADQueryClient.<>c_DisplayClass32_0.<QueryWithRetry>b_0()~~ at Microsoft.ConfigurationManager.AzureADDiscovery.AzureADQueryClient.InvokeOperationWithRetry(Action action, Int32 retryCount)~~ at Microsoft.ConfigurationManager.AzureADDiscovery.AzureADQueryClient.QueryWithRetry(String graphRequest)~~ at Microsoft.ConfigurationManager.AzureADDiscovery.AzureADSyncManager.Sync(Boolean runFullSync), retrying after 30 sec

Any help would be appreciated.

Thanks

mem-cm-co-management
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AllenLiu-MSFT avatar image
1 Vote"
AllenLiu-MSFT answered

Hi, @DannyBanda-2139
Thank you for posting in Microsoft Q&A forum.
We need to grant permissions on both the client app and server app in Azure.
Below article has the details for your reference:
https://systemcenterdudes.com/sccm-azure-active-directory-user-discovery/
(Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.)


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DannyBanda-2139 avatar image
0 Votes"
DannyBanda-2139 answered

Hi @AllenLiu-MSFT,

Thank you for your help!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.