IT Automation Samples and Learning

That’s a great news from Uipath…
Expecting few more samples for easy learning. Which activity we can use for updating the details(for eg: phone number, address etc) while user creation? Plz share samples if possible. :slightly_smiling_face:

2 Likes

Hi Rahul,

In order to update the properties of an existing user/group/computer, please use Update Object Properties activity.

With this activity, you can update the value of a single property, like shown in New Manager workflow above. If you want to update multiple properties at once, you shall create a DataTable object similar with the one presented in Employees Onboarding.

More details about the parameters of Update Object Properties activity:

  • DistinguishedName* (String) - The Distinguished Name of the object.

  • SingleProperty (String) - The name of a specific property (e.g. “displayName”).

  • SingleProperty Value (Object) - The new value of the single property.

  • Properties (DataTable) - A DataTable object. It shall contain two columns, the first one representing the property name and the second its value.

    • If present, the Single Property & Single Property Value will be ignored.

Thanks a lot Ovi for the quick response… :slightly_smiling_face:

1 Like

Welcome Rahul. Ovi is exactly how my friends call me :smile:

2 Likes

uipath

as per this sample its trying to create the Surname. But how the row name “sn” will identify that property.
When I checked in AD the object name is Surname. Could you please brief about the Row name that we are providing here , the Distinguishable name and object class name in other activities?

In order to identify the exact property/attribute LDAP names that you shall use (eg. “sn”, “distinguished name”, “title”), I recommend you to install Active Directory (AD) Explorer which gives you such view. If you use AD Explorer’s Search functionality you will see the list of objectClasses too. Check it here AD Explorer - Windows Sysinternals | Microsoft Docs

This is another helpful link, but in my opinion using AD Explorer is the better option:

Locate for example “Surname” and click on it and you will see the Ldap-Display-Name is “sn”.

Or this page: SelfADSI : Attributes for Active Directory Users

Thanks Ovi…Now its clear. :blush:

1 Like

IMG_20190812_143853 How we can create a folder in profile tab. I’m able to update the details but folder is not getting created. But if I click apply again its creating.

@ovidiuponoran i am trying to find distinguished name with object class in active directory but it gives me nothing. any help? or can you point out the mistake in the screenshot i provided?

Hi @rameezimtiaz

About Get Objects by Filter:
The value of an “objectClass” attribute is an array. You can provide only single value in PropertyValue (for “objectclass” property) or ObjectClass parameters and this value is searched for in that array.
For example, if you want to return the distinguished names of all users, set the following values: ObjectClass=“user”, objectCategory=“person” + specify a property filter that is always true, eg. PropertyToFilterBy=“cn”, PropertyValue="*"

If you want a more advanced filtering, better use Get Objects by LDAP filter.
For example, you can set LDAPFilter to “(&(objectClass=user)(objectClass=top)(objectClass=person)(objectClass=organizationalPerson))”
For more details about LDAP filtering check these articles:

https://confluence.atlassian.com/kb/how-to-write-ldap-search-filters-792496933.html

https://social.technet.microsoft.com/wiki/contents/articles/5392.active-directory-ldap-syntax-filters.aspx

1 Like

@ovidiuponoran Thanks for the quick response. I am still not able to get one single distinguished name. Can you write a query that will return me the DN of Users?
i have also tried “cn=users”. this returns 2 separate locations

@ovidiuponoran I was able to get desired result by “(&(cn=users)(objectClass=container))”
Thanks alot for your help

1 Like

@ovidiuponoran,
i need to extract the properties of “info”, how can i do this using “Get Objects by Filter” ?
image

Hi @ANSHUL

“Get Objects By Filter” or “Get Objects by LDAP Filter” filter return a collection of object distinguished names matching the filter criteria. Some examples of filters for “Get Objects by LDAP Filter” are available here: TechNet Wiki

In order to return the value of “info” attribute of a specific AD object, you need to use “Get Object Properties” by passing the distinguished name of the needed object & set the value of SingleProperty to “info”. The value is returned in SinglePropertyValue output parameter.

@ovidiuponoran, i tried using, but this returns blank:

Hi @ANSHUL,

I’ve just tested it and it works fine. My guess is the OrganizationalUnit distinguished name you are using for Location parameter does not point to the location where you expect to have users with “info” set.


@ovidiuponoran How can I get a specific attribute like Email using “Get Objects by LDAP Filter” activity? The Bussiness Case is I have a name of a person and I want to find the email ids of all the person matching the name I am using the following LDAP query:"(&(anr=Rumel Dutta))"

1 Like

Hi @rumeldutta
In Get Objects by LDAP Filter activity, I think your filter should be “(&(objectCategory=person)(objectClass=user)(anr=Rumel Dutta))”.
As output you will receive a list of users’ distinguished names.
For each distinguished name in this list, you should call Get Object Properties:

  • DistinguishedName = a distinguished name from this list
  • SingleProperty = the name of the property/attribute you want to get the value from, i.e. “mail”

BTW, for more examples of LDAP filters:

http://www.selfadsi.org/ldap-filter.htm
https://social.technet.microsoft.com/wiki/contents/articles/5392.active-directory-ldap-syntax-filters.aspx

1 Like