VMware Cloud Community
mejooo
Contributor
Contributor

"ActiveDirectory.searchRecursively" Not returning any objects

After checking all of your posts, I realized that I can use ActiveDirectory object to search for "User". However; after setup up my default Active Directory; as requested; I still can't get any results? what am I missing exactly?

ActiveDirectory.searchRecursively("User", username);

Reply
0 Kudos
9 Replies
iiliev
VMware Employee
VMware Employee

Hi,

Please provide a bit more details:

  • What are the build numbers of vRO server and AD plug-in?
  • What is the format of the user name - "myuser", "myuser@domain.com", "CN=myuser,DC=domain", or something else?
  • Are you able to find your user in vRO inventory tree or in a object chooser for workflow input parameter of type AD:User ?
  • What exactly is the result of this method call - null value, empty array, or error message?
  • Are there any errors around the time you call this method in vRO log files - server.log (server side) and vso.log (client side)?
Reply
0 Kudos
mejooo
Contributor
Contributor

Thanks a lot for your time,

  • What are the build numbers of vRO server and AD plug-in?

          vRO is in version 7.20 and AD plug-in is in version 3.0.3

  • What is the format of the user name - "myuser", "myuser@domain.com", "CN=myuser,DC=domain", or something else?

          CN=myuser,OU=XXXX,OU=XXXX,DC=XXXX,DC=com

  • Are you able to find your user in vRO inventory tree or in a object chooser for workflow input parameter of type AD:User ?

        Yes, I'm

  • What exactly is the result of this method call - null value, empty array, or error message?

         NULL ARRAY

  • Are there any errors around the time you call this method in vRO log files - server.log (server side) and vso.log (client side)?

          No errors in vso.log; unfortunately I don't have access nor admin rights to backend to be able see "server.log"

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

OK, I'm not sure if the searching for users using the format "CN=myuser,..." is supported by the plug-in. Will check in the plug-in's source code.

Could you check if searching works if you use the format "myuser" ?

Reply
0 Kudos
igaydajiev
VMware Employee
VMware Employee

ActiveDirectory.searchRecursively("User", username);

will do startsWith "username" on following "User" class  attributes "sAMAccountName", "userPrincipalName", "displayname", "givenName", "sn", "cn"

For example I have  following user :

"sAMAccountName":"ivo",

"userPrincipalName":"ivo@gia.net",

"displayname": "Ivo",

"givenName":"Ivo",

"sn":"ivo",

"cn":"ivo"

It returns the user with following call.

> ActiveDirectory.searchRecursively("User", "ivo");

Note that search is performed only in default host (or host provided  as intput parameter searchRecursively method  ) and is also limited to entries inside configured "Base"

Reply
0 Kudos
mejooo
Contributor
Contributor

Sorry for the confusion, I actually search for the user name as "myuser" not as "CN=myuser, OU=XXX, ......"

Reply
0 Kudos
mejooo
Contributor
Contributor

Could you please further elaborate on "limited to entries inside configured "Base" ".

Thanks..

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

When you register an AD server using the workflow 'Add an Active Directory server', one of the required input parameters is Base (usually, it is LDAP DN looking like DC=XXXX,DC=com).

Does the last parts of DN of your user (CN=myuser,OU=XXX,DC=XXXX,DC=com) match the configured Base DN?

Reply
0 Kudos
mejooo
Contributor
Contributor

When I tried the code under a different user, it works perfectly. However, it doesn't work under my user.

Reply
0 Kudos
igaydajiev
VMware Employee
VMware Employee

"myuser" should be fine.

Could you post screen shot of above attributes for expected user?

Their value can be checked using vRO ->Inventory tab->Select required user-> Click on Attributes tab (refer to attached screensot for details)

Reply
0 Kudos