There was a problem with data synchronization-data transfer to ad.The data for the employee (manager) is not updated – the objectkeymanager@ADSAccount field.

There is a boxed script here (and there are commented lines that say that this field should be updated-But it is not updated

Dim func As Func(Of Object) = Function()

    'If $ObjectKeyManager$ isnot nothing andalso $ObjectKeyManager$.Length > 0 Then

                '               Return $ObjectKeyManager$ ' закомментировать строку, чтобы руководитель обновлялся в AD

                'End If

                Dim uid_personHead As String = $FK(UID_Person).UID_PersonHead$

                if String.IsNullOrWhiteSpace(uid_personhead) Then Return Nothing

                Dim sql As ISqlFormatter = Session.SqlFormatter

                Dim whereClause As String = sql.AndRelation(

                               sql.Comparison(Table.ADSAccount.SAMAccountName, "adm%", ValType.String, CompareOperator.NotLike),

                               sql.Comparison(Table.ADSAccount.SAMAccountName, "loc%", ValType.String, CompareOperator.NotLike),

                               sql.UidComparison(Table.ADSAccount.UID_Person, uid_personhead)

                )

                Return Session.Source.GetSingleValue(Of String)(Query.From(Table.ADSAccount).Where(whereClause).Select(Table.ADSAccount.XObjectKey))

End Function

 

If Not CBool(Connection.Variables.Get("FULLSYNC")) Then

                Select Case ($FK(UID_TSBBehavior).ITDataUsage:Int$)

                               Case 0:'do not get data from employee

                               Case -1:'fill property initially from the ITData of the employee

                                               If Not $[IsLoaded]:Bool$ Then

                                                               Value = func()

                                               End If

                               Case 1:'update property depending on ITData of the employee

                                               Value = func()

                End Select

End If

 

The problem is solved by manual synchronization .

But why doesn't the synchronization happen automatically

Parents Reply Children
  • Again, during what operation does it not happen automatically? Automatically triggered by what operation (Sync from a to b, ....) exactly.

  • I have another such question. Also according to the manager .In our company, after the dismissal of an employee, the field of the manager is not cleared. There are a number of some problems because of this. In the address book, the dismissed employee is kept in the subordination with the boss. The same thing happens in other systems.Bitrix. Is there any way to configure the manager field to be cleared in the active directory user account?

  • Let's say an employee's manager has changed, or an employee has transferred to another department. Consequently, the head was replaced in persone.However, there were no changes in the ad user account.

  • Was the employee's manager changed during an import or manually in some of the tools or how?

    The template on ADSAccount.ObjectKeyManager is exactly as you have posted it?

    The template is marked as "Overwriting"?

  • the template is the same as it was posted. The overwrite check box is

    Dim func As Func(Of Object) = Function()
    'If $ObjectKeyManager$ isnot nothing andalso $ObjectKeyManager$.Length > 0 Then
    ' Return $ObjectKeyManager$ ' закомментировать строку, чтобы руководитель обновлялся в AD
    'End If
    Dim uid_personHead As String = $FK(UID_Person).UID_PersonHead$
    if String.IsNullOrWhiteSpace(uid_personhead) Then Return Nothing
    Dim sql As ISqlFormatter = Session.SqlFormatter
    Dim whereClause As String = sql.AndRelation(
    sql.Comparison(Table.ADSAccount.SAMAccountName, "adm%", ValType.String, CompareOperator.NotLike),
    sql.Comparison(Table.ADSAccount.SAMAccountName, "loc%", ValType.String, CompareOperator.NotLike),
    sql.UidComparison(Table.ADSAccount.UID_Person, uid_personhead)
    )
    Return Session.Source.GetSingleValue(Of String)(Query.From(Table.ADSAccount).Where(whereClause).Select(Table.ADSAccount.XObjectKey))
    End Function

    If Not CBool(Connection.Variables.Get("FULLSYNC")) Then
    Select Case ($FK(UID_TSBBehavior).ITDataUsage:Int$)
    Case 0:'do not get data from employee
    Case -1:'fill property initially from the ITData of the employee
    If Not $[IsLoaded]:Bool$ Then
    Value = func()
    End If
    Case 1:'update property depending on ITData of the employee
    Value = func()
    End Select
    End If

  • What about

    • Was the employee's manager changed during an import or manually in some of the tools or how?
  • during the transition to another department, the employee's manager changed automatically in the employee card-person. but the ad manager has not changed

  • Okay. What triggered the department change?

    What process triggered then the change of the manager in the person?

    I am insisting because the only reason I am seeing why your template is failing, could be an active FullSync flag during the change at Person.UID_PersonHead.

  • Provoked personnel changes. The person moved from one department to another. We received information about this. I don't have any scripts in the UID_person field and the owerwrites checkbox is not enabled

  • Provoked personnel changes

    Does that mean you changed the setting using the Manager or Object Browser and it doesn't work?