This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARS user rename

Hi All,

how can i rename user object(name) in ars?

for e.g. if department equal to sales it should move to sales ou, have i configured workflow for that. but, before moving to sales ou it should search for name whether already present or not, if present then it should add 1 at the end of name else keep it as it is. 

also, while creation from QC, if two new users will get create in provisioning cycle with same name it should add 1 at the end of the name.

Can anyone help in this?

  • I would recommend that you use a PVG to force the CN (name) and the sAMAccountName to be the same.  The CN does not need to be unique but as you found out the DN does so when you move the object between OUs you can hit clashes.  If you make the CN = sAMAccountName you no longer need to worry about OU moves and having to rename them.  You are already compromising on your CN naming standard by adding numbers for uniqueness when you move the objects. 

    The alternative is to use a workflow and add a script to update the CN when the object moves but I think it is bad practice to rename objects.  Even OU moves can be problematic if you have LDAP based applications as these tend to hard code the DN of the objects they use which means an OU move causes them to fail.  Script too can be written with hard coded paths but this is probably bad practice it's far better to use the NTAccountName as a search parameter. 

  • In answer to your second question on QC and naming clashes I thought there were built in options for this but it appears not.  There certainly are in the PVG rules so it looks like you will need a script.  It's crazy they don't have this in QC.

  • Dear Lee, thank you for your valuable information. 

    As my client needs, user should move to OU according to their department, and if user is already present in the target OU then it should rename the object before moving. i figure out to do the same, i am running premove script before moving, so before moving it will check for unique object name. but i need to scope it out for target OU only. how can take the destination container(from workflow) in my script, so i can limit my search scope only to that container.

    Regards,

    Pal

  • I've not checked this but the $request object is what changed so you should be able to get the parent container from that and use that as the searchroot.  I'd still recommend you start using a unique name for the CN so you don' t need this additional complexity. 

    use the library function Get-Value

    $targetOU = Get-Value $Request 'ParentContainerDN'

    function Get-Value {
     param (
      $obj,
      $attr
     )
     trap {  continue  }
     return $obj.Get($attr)
     return $null
    } # End Function Get-Value

  • They have some policy so accordingly they wants name as "FN LN". 

    Anyways,

    my ou structure is 

    domain name-sales-admin-users

    domain name-marketing-users

    in my workflow i have if else action-and branches as per department and under that i have move action which will move user to sales-admin-users or marketing-users according to department value. 

    before moving i am running premove script, but i want script search scop should be the destination container which is defined in move action of workflow.