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

  • 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

  • I need to transfer data about the manager to ad. but this does not happen, although everything should be correct in the code. Helps only to manually synchronize

  • What version are you using?


    What do you mean by manually synchronize?

  • version 8.1

    manager -object -reapply to templates

    updating employee information in ad

  • I was also advised to activate the data import module in the Synchronization editor-workflows-users

    but I'm not sure that this will help. There is a chance to break everything that is already there

    1. If Checking “data import”, this will  unset FULLSYNC (This means FULLSYNC=false, and most templates DO fire) 2. If Un-checking “data import”, this will  set FULLSYNC (This means FULLSYNC=true, and most templates do NOT fire)

  • Now I am confused. So you are saying your template is functioning if you manually apply the template, and in that case, the data in ADSAccount is updated accordingly and ad-hoc provisioning to AD is triggered. Correct?

    What I do not understand is, what data is not updated if the data changes in AD m or where? What type of sync was running (from AD to OneIM, from OneIM to AD)?

  • Just this data is not updated. This should not happen manually. We have one manager in the employee field. There is a different manager in the active directory account.Why doesn't this happen automatically?

  • 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.