none
MIM Sync Delta Sync not detecting changes RRS feed

  • Question

  • HEllo Everyone,

    i'm having a strange behavior on my MIM Sync Server.

    i'm synchronizing from AD to SQL, and during this sync i have some advanced flows to generate emails and proxies.

    for some reason if a user changes his/her lastname, the change is detected as an update on delta import, howver the delta sync will not work and only the full sync will work. does anybody know why ? 

    simulating the delta Sync shows as if there are no changes detected, only a full sync will work. i don't understand why...

    thanks for the help



    Hitch Bardawil

    Tuesday, September 24, 2019 9:23 AM

All replies

  • Hi,

    So after you run Delta Import and Delta Sync on the AD MA, if you search the SQL MA connector space and select Pending Export Modify do you see any pending exports?  Are you using sync rule provisioning or code and assume that sync to other MA's is working fine??

    Rob

    Tuesday, September 24, 2019 9:38 AM
  • Hi Rob, 

    Thanks for the help, 

    i  noticed there was a mistake in my description of the issue, sorry let me correct my statement

    • i'm synchronizing Mail from AD to SQL using advanced flow, i generate in this flow mail from firstname+lastname
    • i then synchronize this generated email back to AD using a seperate direct Flow (created a different attribute in MV called ADMAIL because of precedence issues)

    it's the synchronization back from SQL to AD that is not working for an update.

    for example

    • i create john smith in AD,
    • code generates jsmith@test.com
    • export to SQL EMail,
    • import Changes
    • then synchronize back this email to AD MAIL.
    • export new mail to AD

    initial creation works well, however if i change the firstname or lastname, the new generated email is pushed to SQL but only comes back to AD with a Full Sync, a delta shows as pending export and does not show the updated email synching back

     

    sorry for being long, hope you can help!


    Hitch Bardawil

    Tuesday, September 24, 2019 3:25 PM
  • Hi,

    Could it be precedence? Have you checked the precedence of your attributes?

    Br,

    Leo


    Did my post help? Please use "Mark as answer" or "Propose as answer". Thank you!

    Wednesday, September 25, 2019 6:21 AM
  • yep it's not a precedence issue as im flowing AD MAil to MV MAil to SQL MAIL then Importing SQL mail to MV Newmail to AD MAil, it's 2 different attributes in the MV so they both have one flow only

    Hitch Bardawil

    Wednesday, September 25, 2019 8:07 AM
  • Hi Hitch,

    Are you using sync rules or code?

    Rob

    Wednesday, September 25, 2019 11:44 AM
  • Hey Rob, 

    i'm using code,


    Hitch Bardawil

    Wednesday, September 25, 2019 3:06 PM
  • Sorry, I have to duck out here, I don't do code!  Normally with sync rules, after you stage the import update to the CS you can then run a preview sync on the object which will show which sync rules are being parsed against the object, not sure if you can do that with code?

    Rob

    Thursday, September 26, 2019 7:59 AM
  • Hi,

    You can do previews with code. 

    Hitch, could you please show us a screenshot of the Sync preview, your Advanced Flows and your code?

    Br,

    Leo


    Did my post help? Please use "Mark as answer" or "Propose as answer". Thank you!

    Monday, September 30, 2019 9:51 AM
  • Hey Leo, 

    Thanks for the help, 

    the steps are the following : got a user who changed his last name from beforenamechange to afternamechange in active Directory

    • delta sync from AD to SQL works well as you can see below:

    Delta Sync AD to SQL

    • Export to SQL exports the change

    • import back from SQL and Delta sync does not detect changes

    • Full Sync Succeeds 

    • Flows for AD MA

    • SQL MA Attribute Flow

    • and here is the Code ! :)
    void IMASynchronization.MapAttributesForExport(string FlowRuleName, MVEntry mventry, CSEntry csentry)
            {
                switch (FlowRuleName)
                {
                    case "ProxytoSQL":
                        int i = 0;
                        if (mventry["WHProxyAddress"].IsPresent)
                        {
                            string[] prox = new string[mventry["WHProxyAddress"].Values.Count];
                            foreach (Value pa in mventry["WHProxyAddress"].Values)
                            {
                                prox[i] = pa.ToString();
                                i++;
                            }
                            string proxySTR = string.Join(" | ", prox);
                            csentry["ProxyAddresses"].Value = proxySTR;
                        }
                        else
                            if (csentry["Email"].IsPresent && !csentry["ProxyAddresses"].IsPresent)
                                csentry["ProxyAddresses"].Value = "SMTP:" + csentry["Email"].Value;
                        break;
    
                    case "EmailUpdate":
                        string initials = null;
                        string prefix = mventry["GivenName"].Value + "." + mventry["sn"].Value; // référence : ce qu'on cherche à avoir, avec éventuellement des chiffres (en plus) à la fin
    
                        if (mventry["initials"].IsPresent)
                        {
                            initials = mventry["initials"].Value.ToLower();
                        }
    
                        prefix = StringFormater(prefix);
                        string suffixe = "@webhelp.com";
                        int affixeNum = 0;
                        var accountName = mventry["UPN"].Value;                   
                        var emails = DuplicatesManager.GetDuplicates(prefix);
                        
                        bool hasUsedInitials = false;
    
                        while (true)
                        {
                            var nb = 0;
                            var comptes = emails.Where(x => x.Email == "smtp:" + prefix + (affixeNum == 0 ? "" : affixeNum.ToString()) + suffixe);
                            nb = comptes.Count();
    
                            if (nb == 0)
                            {
                                break;
                            }
                            else
                            {
                                if (nb == 1 && comptes.First().Name == accountName)
                                {
                                    return;
                                }
                                else if (affixeNum == 0 && !hasUsedInitials && !string.IsNullOrEmpty(initials))
                                {
                                    prefix = prefix.Replace(".", "." + initials + ".");
                                    hasUsedInitials = true;
                                }
                                else
                                {
                                    affixeNum++;
                                }
                            }
                        }
    
                        csentry["Email"].Value = prefix + (affixeNum == 0 ? "" : affixeNum.ToString()) + suffixe;
                        DuplicatesManager.writetomaildb(prefix + (affixeNum == 0 ? "" : affixeNum.ToString()) + suffixe, mventry["UPN"].Value);
                        break;
                }
            }
        }
    }


    Hitch Bardawil

    Monday, September 30, 2019 11:37 AM
  • oh actually i can see that the full sync does some stuff but does not update the email accordingly :(

    Hitch Bardawil

    Monday, September 30, 2019 11:38 AM
  • Hi,

    Ok, thanks. First question: Do you actually see an update when you run the Delta _Import_ on the SQL Agent?

    Before you run the Delta / Full Sync, if you check "Pending Imports". Do you see the update here?

    Also, what kind of run profiles are you using? Multi step? Combined?

    Br,
    Leo


    Did my post help? Please use "Mark as answer" or "Propose as answer". Thank you!

    Monday, September 30, 2019 12:00 PM
  • Sorry Small Fix i worked too fast and forgot a Step :)

    so the Import from SQL(full import as sql doesnt do delta imports) does show the Changes

    the Delta Sync Does update the proxyaddresses but not the email :

    • the full sync does update the mail in destination

    otherwise i'm using single step run profiles

    Cheers


    Hitch Bardawil

    Monday, September 30, 2019 12:11 PM