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

Change initial value of CentralPassword during the creation of a Person

Hello,

In the project that I'm doing for a Customer the have a pattern to define the initial value of the password based on the FirstName, LastName and the date of the creation.

I'm modifying the CentralPassword Template to generate it but after the creation of the Person, the password is not configured correctly. Is not empty so probably is using a random password.

How could I modify that column so the first value is based in my code instead of in a random password?

The purpose if this is generate two different AD account in different domains but with the same password and, whenever a helpdesk person changes the centralpassword, replicates it to the domains.

Thx!

Parents
  • You may wanna share the code of your template to make it easier for the community members to help you out. Thank you.

  • Hello,

    Here is the code:

    If NOT $[IsLoaded]:Bool$ Then

        'Chequeamos que haya First Name y Last Name
        If String.IsNullOrEmpty($Firstname$) AndAlso String.IsNullOrEmpty($Lastname$) Then
            Dim today As Date = DateTime.now
            Dim Password As String = ""
            Password += $FirstName$.Substring(0,1)
            Password += "*"
            If today.Day.ToString().Length = 1 Then
                Password += "0" + today.Day.ToString()
            End If
            If today.Month.ToString().Length = 1 Then
                Password += "0" + today.Month.ToString()
            End If
            Password += "*"
            If $LastName$.Length > 2 then
                Password += $LastName$.Substring($LastName$.Length - 2)
            else
                Password += $LastName$
            end if
            Password = Password.ToLower
            Value = Password

            'Hardcoded Password

            'Value = "Abcd.1234!"


        end if

    End If

  • Okay. Now please share

    • What version are you using?
    • Is your database encrypted?
    • The column you have placed the template on is Person.CentralPassword I assume?
  • Your code is only executed if FirstName is empty etc ....... I assume you meant NOT empty?

     If String.IsNullOrEmpty($Firstname$) AndAlso String.IsNullOrEmpty($Lastname$) Then

Reply Children