private static void ProcessBatch(ADToPermissionCenterSynchronizer context, EntityMappingCollection mappings, ADHelper adHelper, int startIndex, int size) { string[] propertiesToGet = { "sAMAccountName", "mail", "msRTCSIP-PrimaryUserAddress" }; IEnumerable <SearchResult> adResults = SynchronizeHelper.GetSearchResultsByPropertyValues(adHelper, "sAMAccountName", mappings.ToKeyArray("CodeName", startIndex, size), ADSchemaType.Users, propertiesToGet, size); Dictionary <string, SimpleUser> codeNameDict = mappings.ToCodeNameDictionary(startIndex, size); List <SimpleUser> changes = DiscoverChanges(codeNameDict, adResults); ApplyChanges(changes, context); }