private static bool PreDecorate(ExSearchResultEntry entry, Connection sourceConnection, TargetConnection targetConnection, object state) { if (!entry.IsDeleted) { foreach (string text in MserveSynchronizationProvider.AddressAttributeNames) { if (entry.Attributes.ContainsKey(text)) { DirectoryAttribute directoryAttribute = entry.Attributes[text]; if (text.Equals("msExchArchiveGUID", StringComparison.OrdinalIgnoreCase)) { if (entry.Attributes.ContainsKey("msExchArchiveGUID")) { DirectoryAttribute value = null; if (MserveSynchronizationProvider.TryTransformAchiveGuidToSmtpAddress(directoryAttribute, out value)) { entry.Attributes["ArchiveAddress"] = value; } else { entry.Attributes["ArchiveAddress"] = new DirectoryAttribute("ArchiveAddress", MserveSynchronizationProvider.EmptyList); } } entry.Attributes.Remove("msExchArchiveGUID"); } else { List <string> list = new List <string>(); for (int j = 0; j < directoryAttribute.Count; j++) { string text2 = directoryAttribute[j] as string; if (text2.StartsWith("smtp:", StringComparison.OrdinalIgnoreCase) || text2.StartsWith("meum:", StringComparison.OrdinalIgnoreCase)) { list.Add(text2); } } entry.Attributes[text] = new DirectoryAttribute(directoryAttribute.Name, list.ToArray()); } } } } else { Dictionary <string, DirectoryAttribute> dictionary = sourceConnection.ReadObjectAttribute(entry.DistinguishedName, true, new string[] { "msExchExternalSyncState" }); foreach (string key in dictionary.Keys) { entry.Attributes.Add(key, dictionary[key]); } } return(true); }
public override void Initialize(EdgeSyncConnector connector) { this.identity = ((EdgeSyncMservConnector)connector).Name; this.targetServerConfigs = new List <TargetServerConfig>(); this.targetServerConfigs.Add(new MserveTargetServerConfig(((EdgeSyncMservConnector)connector).Name, ((EdgeSyncMservConnector)connector).ProvisionUrl.AbsoluteUri, ((EdgeSyncMservConnector)connector).SettingUrl.AbsoluteUri, ((EdgeSyncMservConnector)connector).RemoteCertificate, ((EdgeSyncMservConnector)connector).PrimaryLeaseLocation, ((EdgeSyncMservConnector)connector).BackupLeaseLocation)); if (MserveSynchronizationProvider.partnerId == -1) { MserveSynchronizationProvider.LoadPartnerId(); } if (string.IsNullOrEmpty(MserveSynchronizationProvider.rootDomainLostAndFoundContainerDN)) { MserveSynchronizationProvider.LoadRootDomainLostAndFoundContainerDN(); } }