public void Execute()
        {
            logger.Info("Extract Users List in progress...");
            var         projectCollections = CatalogNodeBrowsingHelper.GetProjectCollections(configurationServer.CatalogNode);
            List <User> userList           = IdentityServiceManagementHelper.GetAllIdentities(configurationServer, projectCollections).ToList();

            // Now get the "ou" attribute from the Active Directory (so as to gets a user's Service)
            if (this.extractOUOption)
            {
                logger.Info("Fetch the ou property in the AD");
                Fetch_OU_ADProperty(userList);
            }

            string fileName = FileNameTool.GetFileName("TfsExtractUsersList");

            using (CsvWriter csv = new CsvWriter(new StreamWriter(fileName)))
            {
                csv.Configuration.RegisterClassMap <ProjectDefinitionCsvMap>();
                csv.WriteExcelSeparator();

                if (this.extractOUOption)
                {
                    csv.WriteRecords(userList.Where(x => !string.IsNullOrEmpty(x.OU) && !x.OU.StartsWith(Environment.GetEnvironmentVariable("LDAP_OU_FILTER_OUT"))).DistinctBy(x => x.OU).OrderBy(x => x.Name));
                }
                else
                {
                    csv.WriteRecords(userList.DistinctBy(x => x.Mail).OrderBy(x => x.Name));
                }
            }

            logger.Info("Extract Users done");
        }
Example #2
0
        public ActionResult CollectionOverview()
        {
            CollectionOverviewModel com = new CollectionOverviewModel();

            com.ProjectCollections = CatalogNodeBrowsingHelper.GetProjectCollections(configurationServer.CatalogNode);
            return(PartialView(com));
        }
        public ActionResult ProjectOverview(string id)
        {
            ProjectOverviewModel pom = new ProjectOverviewModel();

            if (!string.IsNullOrWhiteSpace(id))
            {
                TfsTeamProjectCollection tpc = configurationServer.GetTeamProjectCollection(new Guid(id));
                pom.Projects = CatalogNodeBrowsingHelper.GetTeamProjects(tpc.CatalogNode, false);
            }
            return(PartialView(pom));
        }
Example #4
0
        // GET: DashboardView
        public ActionResult Index()
        {
            OrganizationalOverviewModel dashb = new OrganizationalOverviewModel()
            {
                ProjectCollectionCollection = CatalogNodeBrowsingHelper.GetProjectCollections(configurationServer.CatalogNode),
                ProjectCount = CatalogNodeBrowsingHelper.GetTeamProjects(configurationServer.CatalogNode, true).Count(),
                UserCount    = IdentityServiceManagementHelper.GetAllIdentityCount(configurationServer.GetService <IIdentityManagementService>())
            };

            return(View(dashb));
        }
        // GET: DashboardView
        public ActionResult Index()
        {
            var projectCollections = CatalogNodeBrowsingHelper.GetProjectCollections(configurationServer.CatalogNode);

            OrganizationalOverviewModel dashb = new OrganizationalOverviewModel()
            {
                ProjectCollectionCollection = projectCollections,

                ProjectCount = CatalogNodeBrowsingHelper.GetTeamProjects(configurationServer.CatalogNode, true).Count()
            };

            return(View(dashb));
        }
        // GET: CollectionOverview
        public ActionResult Index(string id)
        {
            // Get the catalog of team project collections
            ICollection <ProjectCollectionDefinition> projectCollections = CatalogNodeBrowsingHelper.GetProjectCollections(configurationServer.CatalogNode);

            List <SelectListItem> tpcList = new List <SelectListItem>();

            foreach (ProjectCollectionDefinition collection in projectCollections)
            {
                // Use the InstanceId property to get the team project collection

                tpcList.Add(new SelectListItem {
                    Text     = collection.Name,
                    Value    = collection.InstanceId.ToString(),
                    Selected = collection.InstanceId.ToString() == id
                });
            }

            ViewBag.TpcList = tpcList;

            return(View());
        }