public async Task RunCaseManagerImportAsync()
        {
            var tbServices = await _referenceDataRepository.GetAllActiveTbServicesAsync();

            using (var adDirectoryService = _adDirectoryServiceFactory.Create())
            {
                var usersInAd = adDirectoryService.LookupUsers(tbServices);
                await _adUserService.AddAndUpdateUsers(usersInAd);
            }
        }
Example #2
0
        public async Task RunCaseManagerImportAsync()
        {
            var tbServices = await _referenceDataRepository.GetAllTbServicesAsync();

            using (var adDirectoryService = _adDirectoryServiceFactory.Create())
            {
                foreach (var(user, tbServicesMatchingGroups) in adDirectoryService.LookupUsers(tbServices))
                {
                    Log.Information($"Updating user {user.Username}");
                    await _userRepository.AddOrUpdateUser(user, tbServicesMatchingGroups);
                }
            }
        }