Ad Group synchronization error

Hi all

I have to run a synchronization involving AD Groups and AccProduct table. In details, once a given group is read from AD, I need to find a Product in the AccProduct Table with Ident_AccProduct equals to SamAccountName of the group.

This procedure is pretty simple and it works fine against hundreds of groups except when in the following case: the Group’s SamAccountName is something like xxxxxx$MISERVER$xxxx.

The query I implemented to get the AccProduct is as following:

 Dim AccProdObjectResult = SystemObject.Connection.QueryObject(SystemQuery _
   .From("AccProduct") _
   .Select("CustomProperty01","UID_AccProduct") _
   .Filter("Ident_AccProduct = '" &  cstr(AccProd) & "'" )
   ).Result

 

where AccProd is equal to xxxxxx$MISERVER$xxxx.

the exception message is " Error loading system objects of class AccProduct (all) (AccProduct_Master)."

I’m afraid this error is related to the $----$ chars into the SamAccountName

I've also tried something like 

 Dim AccProdObjectResult = SystemObject.Connection.QueryObject(SystemQuery _
   .From("AccProduct") _
   .Select("CustomProperty01","UID_AccProduct") _
   .Filter("Ident_AccProduct = '" & cstr(AccProd) & "'" )
   ).Result
 

and like 

  Dim AccProdObjectResult = SystemObject.Connection.QueryObject( SystemQuery _     .From("AccProduct") _     .Select("CustomProperty01","UID_AccProduct") _     .Filter(String.Format("Ident_AccProduct = '{0}'",cstr(AccProd) ))     ).Result

 

but nothing changes.

Please can someone advices me about how to solve this issue?

Parents
  • Hi,

    The problem seems quite clear to me:

    1777260] Unknown variable (MISERVER)!

    The connector is looking for a declared/defined variable in the sync project called MISERVER.  The notation for referencing a variable is $<var>$ ..... and that is exactly the notation you have in the string value of the incoming samAccountName.

    This "looks like" a bug to me in that I think the connector should take the literal string value of the attribute from the target system ...... it "looks like" it is putting it through some internal variable replacement routine.

    I would suggest to open a case with support to verify if it really is a bug and they will assist you towards a resolution should that be the case.

    HTH, Barry.

  • Thnaks Barry.

    this is also my conclusion. 

    I hope there is a workaround to execute that query without involving the connector.

    Alberto

Reply Children
  • Same as Barry. Please contact support. But why are you not using a key resolution property for fetching the value from AccProduct? It may be a workaround for your script issue.

  • Markus,
    I need to execute some more tasks inside the script. In this case I cannot rely on a KRP. I'm afraid I need to adapt to the solution I found on server. 

    Alberto

  • Or,  you fetch the UID_AccProduct using another Key resolution property and reference this vrtProperty in the rest of your script.

  • Hi Markus

    That’s interesting solution but I’m afraid I cannot rely on it neither.

    Unfortunately, the relation between the SamAccountName and the Ident_AccProduct is something like

    SamAccountName = xxx_Indet_AccProduct_yyy

    I think I cannot instruct the KRP to match that pattern. If I’m wrong, please advice.

    Is there a way to execute e “plain SQL query”, it this way excluding the connector? I mean, can I write something like Something.SomethingElse.ExecuteQuery(“select UID_AccProduct from … where… ”) ?

    Alberto

  • No you cannot write plain SQL. By the way, wouldn't work if you are connected via an application server.

    The $..$ thing just seem to be a problem in the query object so why should SAMAccountName = xxx_Ident_AccProduct_yyy be an issue if you are not using it in an SystemQuery.

  • Markus
    let's say the samaccountname I need to match is xxxxx$MiServer$yyyy and the ident_AccProduct stored on the db  is cccc_xxxxx$MiServer$yyyy_dddd, where cccc and dddd are constant strings.
    In the code I submitted, the value cccc_xxxxx$MiServer$yyyy_dddd is stored in the variable AccProd and it is correctly formatted.
    I know I cannot write plain SQL… I meant if there is a way to pass "hand written - old fashion query" to the connector or to some other objects, in order to prevent the connector (or any other object) from writing or modifying the query itself.
    Alberto 
  • Did you try something like

    Dim AccProdObjectResult = SystemObject.Connection.QueryObject(SystemQuery _
    .From("AccProduct") _
    .Select("CustomProperty01", "UID_AccProduct") _
    .Filter(SystemObject.Connection.FilterFormatter.Comparison(SystemObject.SchemaType("Ident_AccProduct"), CStr(AccProd), Filter.Formatter.FilterCompareOperator.Equal))
    ).Result

    or is this showing the same error?

  • Hi Markus

    it seems promising but unfortunately the table on which I’m working is AdsGroup, not AccProduct, so the code "SystemObject.Connection.FilterFormatter.Comparison(SystemObject.SchemaType("Ident_AccProduct")… " fails.

    The exception (given 574 times) is 

    "The property (Ident_AccProduct) does not exist in schema type (Active Directory groups (ADSGroup))"

    Is there a way to “point” the system object to the AccProduct table?

     

    Alberto

  • You are right, forgot about that.

    Again, I'll try to find a workaround for you. You should contact support in addition.

    But as a workaround, you could take my approach and refine it a little bit.

    1. You create virtual property to build your AccProduct string (cccc_xxxxx$MiServer$yyyy_dddd) vrtAccProduct based on the SAMAccountName
    2. You fetch the UID_AccProduct using another Key resolution property (name it for example vrtUID_AccProduct). The Key Resolution property searches for the vrtAccProduct created in step 1.
    3. If you need the UID_AccProduct elsewhere, you can reference it in the rest of your script.
  • Next attempt:

    Dim AccProdObjectResult = SystemObject.Connection.QueryObject(SystemQuery _
    .From("AccProduct")
    .Select("CustomProperty01", "UID_AccProduct")
    .Filter(SystemObject.Connection.FilterFormatter.Comparison(SystemObject.Connection.Schema.Types("AccProduct").Properties("Ident_AccProduct"), CStr(AccProd), Filter.Formatter.FilterCompareOperator.Equal))

    ).Result