Query users - Azure Active Directory. Error with On Premise Sam Account Name
I am getting an error when using the “On Premise Sam Account Name” field in conditions. Error is : Unsupported or invalid query filter clause specified for property 'onPremisesSamAccountName' of resource 'User'.
When testing this in Postman (or MS Graph explorer) I am able to get it to work but it needs some modification from a basic command or it gets the same Error. What needs to happen in the GET command is “$count=true” needs to be added and and in request headers key “ConsistencyLevel” with value “eventual” must be added.
So my questions:
can the default Azure Active Directory Query Users activity be use the “On Premise Sam Account Name” field in conditions? Maybe I am missing something.
Should I try to just use “Call a Web Service” and customize it to GET from AAD?
This is how it is setup now.
Page 1 / 1
Hi @Scottg,
You’re not missing anything. The Microsoft Graph API just don’t work the same with On-Premise properties conditions parameters.
I will not recommend to use the action “Call a web service” as it is not secure.
I recommend to use Nintex Xtensions to get the API request as an action which is more secure as then the connection authentication will be encrypted.
1- Create the Xtensions : Below the swagger file I created specifically for that API request “/users?$count=true&$filter=onPremisesSamAccountName eq '{onPremisesSamAccountName}'”.
On Nintex Automation Cloud, add an Xtension and upload the OpenAPI specification file :
Then specifiy the client ID and client Secret (as it rely on Azure AD App registration with the right permissions to Users API) :
Then specify connector details :
2- Create the connection and specify the Azure AD Tenant ID and publish. This will start the OAuth authorization.
Once the connection is created you can implement the action within any workflows as shown below :
I have 2 users with “james.bond” SAM Account name but only 1 on-premise as retrieved above.
I use Nintex Xtensions quite often to extend the native connectors and for any external OpenAPI.
Hope that helps !
@cecilia-penha thank you very much . I will test that out. Defiantly looks like a better and more secure method.
@cecilia-penha I was able to set up the Xtensions connector. It appeared to connect properly but when I run it in the workflow.
>Error Code: IO.XtensionExecute.ErrorResponse]
I can run the same command with a “Get Web Service” and pulling a token with the same ClientID and Secret, so the privileges are correct on the AAD side. Is this a problem with the Xtension? Should I open a support case?
I think I found the issue. The Xtensions app is using delegated not application permissions with Graph call. I can repoduce in postman.
Now just need to figure out how to make the make it work with the correct permission.