UiPath Documentation
activities
latest
false
IT 自动化活动
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

员工入职

创建新的 NetIQ eDirectory 用户,并使用 UiPath.NetIQeDirectory.Activities 将其添加到适当的部门和组。

以下示例说明了如何创建新的目录用户并将其添加到关联的部门和组。

该窗口会显示NetIQ EDirectory 作用域创建用户强制更改密码将用户添加到组等活动。您可以在UiPath.NetIQeDirectory.Activities包中找到这些活动。

创建工作流

在创建以下工作流之前,需要安装以下包:

  • UiPath.NetIQeDirectory.Activities
  • UiPath.System.Activities
  • UiPath.WebAPI.Activities

此自动化流程的构建方法如下:

  1. 打开 Studio,并新建一个默认命名为“主要”的“流程”

  2. Drag a Sequence container into the Workflow Designer and name it Main Sequence.

  3. Select the Main Sequence container and create the following variable:

    变量名称变量类型默认值
    ldapServer字符串
    ldapAdminUser字符串
    ldapAdminPassword字符串
  4. Drag another sequence inside the Main Sequence container and name it Init Sequence.

  5. Drag a Get Robot Asset activity inside the Init Sequence container.

    • Add the variable "LdapServer" inside the Asset Name field.
    • Add the variable ldapServer inside the Asset value field.
  6. Drag a Get Robot Credentials activity below the Get Robot Asset activity.

    • Add the variable "LdapServerCredentials" inside the Asset Name field.
  7. Drag another sequence below the Init Sequence container and name it CreateUser Sequence.

  8. Select the CreateUser Sequence container and create the following variable:

    变量名称变量类型默认值
    userAttributesDt字符串
    userInitialPassword字符串
    userSAMAccountName字符串
    userLocation字符串
    userCN字符串
    userExists布尔值
    employeesGroup字符串
    userDepartmentGroup字符串
  9. Drag another Sequence inside the CreateUser Sequence container and name it Set User Attributes Sequence

  10. Drag a Multiple Assign activity inside the Set User Attributes Sequence container.

    • 在“收件人”字段中添加“userCN”变量。
    • 在“值”字段添加表达式 FirstName+" "+LastName
    • Click the Add button to add another Assign row, and add the variable userSAMAccountName in the To field.
    • 在“值”字段添加表达式 (FirstName+"."+LastName).ToLower
    • Click the Add button to add another Assign row, and add the variable userInitialPassword in the To field.
    • 在“值”字段添加表达式 "1qazXSW@"
    • Click the Add button to add another Assign row, and add the variable employeesGroup in the To field.
    • 在“值”字段添加表达式 "CN=Employees,OU=Employee-Onboarding,OU=Demo,DC=dev1,DC=local"
  11. Drag a Sequence container below the Multiple Assign activity and name it DT Set Extra Attributes Sequence.

  12. Drag a Build Data Table activity inside the DT Set Extra Attributes Sequence container.

    • In the Properties panel, add the variable userAttributesDt in the DataTable field.
  13. Drag a Add Data Row activity below the Build Data Table activity.

    • Add the expression {"givenName",FirstName} in the ArrayRow field.
    • 在“数据表”字段中添加“userAttributesDt”变量。
  14. Drag another Add Data Row activity below the previous Add Data Row activity.

    • Add the expression {"sn",LastName} in the ArrayRow field.
    • 在“数据表”字段中添加“userAttributesDt”变量。
  15. Drag another Add Data Row activity below the previous Add Data Row activity.

    • Add the expression {"department",Department} in the ArrayRow field.
    • 在“数据表”字段中添加“userAttributesDt”变量。
  16. Drag another Add Data Row activity below the previous Add Data Row activity.

    • Add the expression {"title",Title} in the ArrayRow field.
    • 在“数据表”字段中添加“userAttributesDt”变量。
  17. Drag another Add Data Row activity below the previous Add Data Row activity.

    • Add the expression {"telephoneNumber",Telephone} in the ArrayRow field.
    • 在“数据表”字段中添加“userAttributesDt”变量。
  18. Drag another Add Data Row activity below the previous Add Data Row activity.

    • Add the expression {"mail",Email} in the ArrayRow field.
    • 在“数据表”字段中添加“userAttributesDt”变量。
  19. Drag a Switch activity below the DT Set Extra Attributes Sequence container.

    • Add the value Department in the Expression field.
    • Click the Add new case field and add the value Marketing in the Case field.
    • Click the Add new case field and add the value Sales in the Case field.
    • Click the Add new case field and add the value Legal in the Case field.
    • Click the Add new case field and add the value Accounting in the Case field.
  20. Add a Multiple Assign activity inside the Marketing Case container.

    • 在“收件人”字段中添加“userLocation”变量。
    • 在“值”字段添加表达式 "OU=Marketing,OU=Employee-Onboarding,OU=Demo,DC=dev1,DC=local"
    • Click the Add button and add the variable userDepartmentGroup in the To field.
    • 在“值”字段添加表达式 "CN=DepartmentMarketing,OU=Marketing,OU=Employee-Onboarding,OU=Demo,DC=dev1,DC=local"
  21. Add a Multiple Assign activity inside the Sales Case container.

    • 在“收件人”字段中添加“userLocation”变量。
    • 在“值”字段添加表达式 "OU=Sales,OU=Employee-Onboarding,OU=Demo,DC=dev1,DC=local"
    • Click the Add button and add the variable userDepartmentGroup in the To field.
    • 在“值”字段添加表达式 "CN=DepartmentSales,OU=Sales,OU=Employee-Onboarding,OU=Demo,DC=dev1,DC=local"
  22. Add a Multiple Assign activity inside the Legal Case container.

    • 在“收件人”字段中添加“userLocation”变量。
    • 在“值”字段添加表达式 "OU=Legal,OU=Employee-Onboarding,OU=Demo,DC=dev1,DC=local"
    • Click the Add button and add the variable userDepartmentGroup in the To field.
    • 在“值”字段添加表达式 "CN=DepartmentLegal,OU=Legal,OU=Employee-Onboarding,OU=Demo,DC=dev1,DC=local"
  23. Add a Multiple Assign activity inside the Accounting Case container.

    • 在“收件人”字段中添加“userLocation”变量。
    • 在“值”字段添加表达式 "OU=Legal,OU=Employee-Onboarding,OU=Demo,DC=dev1,DC=local"
    • Click the Add button and add the variable userDepartmentGroup in the To field.
    • 在“值”字段添加表达式 "CN=DepartmentLegal,OU=Legal,OU=Employee-Onboarding,OU=Demo,DC=dev1,DC=local"
  24. Add a NetIQ eDirectory Scope activity below the Set user Attributes Sequence container.

    • In the Properties panel, select the LDAP option from the dropdown list.
    • Add the variable ldapServer in the LDAPServer field.
    • Add the variable ldapAdminPassword in the Password field.
    • Add the variable ldapAdminUser in the Username field.
  25. Drag a NetIQ eDirectory User Exists activity inside the NetIQ eDirectory Scope activity.

    • Select the SAMAccountName option from the dropdown list.
    • 在“值”字段中添加变量 userSAMAccountName
  26. Drag an If activity below the NetIQ eDirectory User Exists activity.

    • 在“条件”字段中添加表达式“Not userExists”。
  27. Drag a Sequence activity inside the Then container.

  28. Drag a NetIQ eDirectory Create User activity inside the Seqence container.

    • Add the variable userLocation in the Location field.
    • Add the variable userSAMAccountName in the SAMAccountName field.
    • Add the variable userInitialPassword in the Password field.
  29. Drag a NetIQ eDirectory Force Password Change activity below the NetIQ eDirectory Create User activity.

    • Add the variable userDN in the DistinguishedName field.
  30. Drag a NetIQ eDirectory Add User To Group activity below the NetIQ eDirectory Force Password Change activity.

    • Add the variable userDN in the UserDistinguishedName field.
    • Add the variable employeesGroup in the GroupDistinguishedName field.
  31. Drag a NetIQ eDirectory Add User To Group activity below the previous NetIQ eDirectory Add User To Group activity.

    • Add the variable userDN in the UserDistinguishedName field.
    • Add the variable userDepartmentGroup in the GroupDistinguishedName field.
  32. Drag a Log Message activity below the NetIQ eDirectory Add User To Group activity.

    • Select the Info option from the dropdown list.
    • 在“行”字段中添加表达式“"User Created: " + userSAMAccountName”。
  33. Drag a Sequence activity inside the Else container.

  34. Drag a Log Message activity inside the Sequence* container.

    • Select the Error option from the dropdown list.
    • 在“行”字段中添加表达式“"User already exists for sAMAccountName: " + userSAMAccountName”。
  35. Drag a Throw activity below the Log Message activity.

    • In the Properties panel, select the Error option from the dropdown button.
    • 在“行”字段中添加表达式“"User already exists for sAMAccountName: " + userSAMAccountName”。
  36. 运行流程。 机器人将创建一个新的目录用户,并将其添加到关联的部门 OU 和组中。

以下是工作流在 UiPath Studio 中的外观:

这是运行工作流的结果:

  • 创建工作流

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新