示例#1
0
 private void BuildDomainList()
 {
     foreach (Domain d in this.domainTrustProvider.GetDomains())
     {
         JitDomainStatusViewModel vm = jitDomainStatusFactory.CreateViewModel(d, this.GetDynamicGroupMapping(d));
         this.Domains.Add(vm);
     }
 }
示例#2
0
        private void BuildDomainList()
        {
            JitDomainStatusViewModel vm;

            foreach (var d in Forest.GetCurrentForest().Domains.OfType <Domain>())
            {
                vm = jitDomainStatusFactory.CreateViewModel(d, this.GetDynamicGroupMapping(d));
                this.Domains.Add(vm);
            }

            foreach (var trust in Domain.GetCurrentDomain().Forest.GetAllTrustRelationships().OfType <TrustRelationshipInformation>())
            {
                if (trust.TrustDirection == TrustDirection.Inbound || trust.TrustDirection == TrustDirection.Bidirectional)
                {
                    var forest = Forest.GetForest(new DirectoryContext(DirectoryContextType.Forest, trust.TargetName));

                    foreach (var d in forest.Domains.OfType <Domain>())
                    {
                        vm = jitDomainStatusFactory.CreateViewModel(d, this.GetDynamicGroupMapping(d));
                        this.Domains.Add(vm);
                    }
                }
            }
        }