Check consistency error generate by a script

Hello everyone,

i have an issue with the script below :

Dim f As ISqlFormatter = Connection.SqlFormatter
Dim whereClause_AccProductGroup As String
Dim whereClause_ITShopOrg As String
Dim whereClause_PWODecisionMethod As String

whereClause_AccProductGroup = f.Comparison("FullPath", "Appartenir à une liste de diffusion", ValType.String)
whereClause_ITShopOrg = f.AndRelation(f.Comparison("Ident_Org", "Groupes de distribution Azure Active Directory", ValType.String), _
f.Comparison("ITShopInfo", "BO", ValType.String))
whereClause_PWODecisionMethod = f.Comparison("Ident_PWODecisionMethod", "Policy - Souscription à un groupe de diffusion", ValType.String) 

values("UID_AccProductGroup") = Connection.GetSingleProperty("AccProductGroup","UID_AccProductGroup", whereClause_AccProductGroup).String
values("UID_ITShopOrg") = Connection.GetSingleProperty("ITShopOrg","UID_ITShopOrg", whereClause_ITShopOrg).String
values("UID_PWODecisionMethod") = Connection.GetSingleProperty("PWODecisionMethod","UID_PWODecisionMethod", whereClause_PWODecisionMethod).String

Dim UID_AccProduct As String
Dim prefix As Integer
prefix = CInt(System.Math.Ceiling(Rnd() * 500000)) + 1
UID_AccProduct = prefix.ToString + $UID_O3EDL$
values("UID_AccProduct") = UID_AccProduct.Substring(0,38)

' ACE 20190502 : Retrieve owners to populate AERole. we filter on ObjectKeyOrdered = '<Key><T>QERReuse</T><P>c5e2f047-1294-42b1-bf6a-e8e5a79fa114</P></Key>' to find PWO that lead to group creation (if any)
Dim UID_PersonWantsOrg as String = Connection.GetSingleProperty("PersonWantsOrg", "UID_PersonWantsOrg", f.AndRelation( _
	f.Comparison("ObjectKeyOrdered", "<Key><T>QERReuse</T><P>c5e2f047-1294-42b1-bf6a-e8e5a79fa114</P></Key>", ValType.String), _
	f.Comparison("CustomProperty01", $Name$, ValType.String)))
Dim CCC_AADGroupOwner01 as String = Connection.GetSingleProperty("PersonWantsOrg", "CCC_AADGroupOwner01", f.Comparison("UID_PersonWantsOrg", UID_PersonWantsOrg, ValType.String))
Dim CCC_AADGroupOwner02 as String = Connection.GetSingleProperty("PersonWantsOrg", "CCC_AADGroupOwner02", f.Comparison("UID_PersonWantsOrg", UID_PersonWantsOrg, ValType.String))

values("UID_PersonInserted") = Connection.GetSingleProperty("PersonWantsOrg", "UID_PersonInserted", f.Comparison("UID_PersonWantsOrg", UID_PersonWantsOrg, ValType.String))
values("UID_Person_Owner01") = Connection.GetSingleProperty("AADUser", "UID_Person", f.Comparison("UID_AADUser", CCC_AADGroupOwner01, ValType.String)).String
values("UID_Person_Owner02") = Connection.GetSingleProperty("AADUser", "UID_Person", f.Comparison("UID_AADUser", CCC_AADGroupOwner02, ValType.String)).String
 

When i run the Check Consistency i have an error "GUID in primary Key with invalid format"

Do you have any suggestion ?

 OIM version 8.0

I would like to resolve this situation before migrating my environment in up to date version  

  • These lines here are probably the reason for the error.

    Dim UID_AccProduct As String
    Dim prefix As Integer
    prefix = CInt(System.Math.Ceiling(Rnd() * 500000)) + 1
    UID_AccProduct = prefix.ToString + $UID_O3EDL$
    values("UID_AccProduct") = UID_AccProduct.Substring(0,38)
    

    I do not understand why you are trying to generate a UID like that?

    Can you post a resulting UID to validate my claim?

  • Hi Markus,

    I'm so sorry i didn't see your reply.

    Here it's an UID from the Table ACCProduct :

    AccProduct 101311663ae568-4f5b-4dd0-981b-76c86ab3

    I'm not the one who made this script, it's an integrator.
    We have see this issue with this script  when i wanted to upgrade the version 8.0 to 9.1 

    And this method for generating the UID is the same on multiple script.
    I would like to change this method of generating but i do not know who to proceed. 

    Sincerely,

    Geoffroy

  • The normal format of a UID is either

    8-4-4-4-12

    or

    <Module prefix>-32

    where the number stands for the number of allowed characters.

    Your IDs are in the format 12-4-4-4-8 which lead to the error in the consistency check.

    I cannot comment on the intentions of the script and why the integrator has chosen this way of generating the UIDs. By default, the system generates the UIDs on its own.

  • Hi Markus,

    By luck do you hane anyy idea who i can change this method ?

    Or i need to just let the system generate the uid and change the way of the script work ?

    This script are use in the process of creating Distribution List in office 365 and group with the same name in our LDAP + publish this Distribution List in IT Shop and work on self-service subscription via the WEB portal

    This script and the others using this lines  are on prod and generate each time wrong UID
    I will  script a method for correcting the wrong  uid in my DB. 

    Thanks for your help

  • I suggest you contact your original implementation partner (or a different one) to help you out here. Without analyzing and understanding the complete reasons behind the original UID creation it would be unwise to give you concrete advice.

    In general you could rely on the system to create new UIDs.