LogMainActivity() публичный статический Метод

public static LogMainActivity ( string msg, string ADPath, string portalPath ) : void
msg string
ADPath string
portalPath string
Результат void
Пример #1
0
 private void DeletePortalContainers(SyncTree syncTree)
 {
     AdLog.LogMainActivity("Deleting portal containers (domains, orgunits, containers)", syncTree.ADPath, syncTree.PortalPath);
     DeleteObjectsFromAD(syncTree,
                         ADObjectType.AllContainers,
                         syncTree.AllADContainers,
                         DeletePortalContainer);
 }
Пример #2
0
 private void DeletePortalGroups(SyncTree syncTree)
 {
     AdLog.LogMainActivity("Deleting portal groups", syncTree.ADPath, syncTree.PortalPath);
     DeleteObjectsFromAD(syncTree,
                         ADObjectType.Group,
                         syncTree.AllADGroups,
                         DeletePortalGroup);
 }
Пример #3
0
 private void DeletePortalUsers(SyncTree syncTree)
 {
     AdLog.LogMainActivity("Deleting portal users", syncTree.ADPath, syncTree.PortalPath);
     DeleteObjectsFromAD(syncTree,
                         ADObjectType.User,
                         syncTree.AllADUsers,
                         DeletePortalUser);
 }
Пример #4
0
 private void SyncGroupsFromAD(SyncTree syncTree)
 {
     AdLog.LogMainActivity("Syncing groups", syncTree.ADPath, syncTree.PortalPath);
     SyncObjectsFromAD(syncTree,
                       ADObjectType.Group,
                       syncTree.AllADGroups,
                       CreateNewPortalGroup,
                       UpdatePortalGroupProperties);
 }
Пример #5
0
 private void SyncUsersFromAD(SyncTree syncTree)
 {
     AdLog.LogMainActivity("Syncing users", syncTree.ADPath, syncTree.PortalPath);
     SyncObjectsFromAD(syncTree,
                       ADObjectType.User,
                       syncTree.AllADUsers,
                       CreateNewPortalUser,
                       UpdatePortalUserProperties);
 }
Пример #6
0
 private void SyncContainersFromAD(SyncTree syncTree)
 {
     AdLog.LogMainActivity("Syncing containers (domains, orgunits, containers)", syncTree.ADPath, syncTree.PortalPath);
     SyncObjectsFromAD(syncTree,
                       ADObjectType.AllContainers,
                       syncTree.AllADContainers,
                       CreateNewPortalContainer,
                       UpdatePortalContainerProperties);
 }
Пример #7
0
        /* ==================================================================================== AD -> portal : Public methods */
        /// <summary>
        /// Syncs all objects of all configured sync trees from Active Directory(ies).
        /// </summary>
        public void SyncFromAD()
        {
            IUser originalUser = User.Current;

            Common.ChangeToAdminAccount();


            // init portal objects
            AdLog.LogMain("Cacheing portal users...");
            _portalUsers = GetAllPortalObjects(ADObjectType.User);
            AdLog.LogMain("Cacheing portal groups...");
            _portalGroups = GetAllPortalObjects(ADObjectType.Group);
            AdLog.LogMain("Cacheing portal containers...");
            _portalContainers = GetAllPortalObjects(ADObjectType.AllContainers);


            foreach (SyncTree syncTree in _syncTrees)
            {
                try
                {
                    SyncContainersFromAD(syncTree);
                }
                catch (Exception ex)
                {
                    // syncing of the whole tree failed
                    AdLog.LogException(ex);
                }
            }
            foreach (SyncTree syncTree in _syncTrees)
            {
                try
                {
                    SyncUsersFromAD(syncTree);
                }
                catch (Exception ex)
                {
                    // syncing of the whole tree failed
                    AdLog.LogException(ex);
                }
            }
            foreach (SyncTree syncTree in _syncTrees)
            {
                try
                {
                    if (syncTree.SyncGroups)
                    {
                        SyncGroupsFromAD(syncTree);
                    }
                    else
                    {
                        AdLog.LogMainActivity("Groups under synctree are skipped", syncTree.ADPath, syncTree.PortalPath);
                    }
                }
                catch (Exception ex)
                {
                    // syncing of the whole tree failed
                    AdLog.LogException(ex);
                }
            }
            foreach (SyncTree syncTree in _syncTrees)
            {
                try
                {
                    DeletePortalUsers(syncTree);
                }
                catch (Exception ex)
                {
                    // syncing of the whole tree failed
                    AdLog.LogException(ex);
                }
            }
            foreach (SyncTree syncTree in _syncTrees)
            {
                try
                {
                    DeletePortalGroups(syncTree);
                }
                catch (Exception ex)
                {
                    // syncing of the whole tree failed
                    AdLog.LogException(ex);
                }
            }
            foreach (SyncTree syncTree in _syncTrees)
            {
                try
                {
                    DeletePortalContainers(syncTree);
                }
                catch (Exception ex)
                {
                    // syncing of the whole tree failed
                    AdLog.LogException(ex);
                }
            }

            // dispose synctrees (searchresultcollection objects contained in synctree)
            foreach (SyncTree syncTree in _syncTrees)
            {
                syncTree.Dispose();
            }

            AdLog.EndLog();

            Common.RestoreOriginalUser(originalUser);
        }