Exemple #1
0
 public GraphNode Locate(DomainKey domain)
 {
     if (data.ContainsKey(domain))
     {
         return(data[domain]);
     }
     return(null);
 }
Exemple #2
0
 public GraphNode(int Id, DomainKey Domain, DateTime ReferenceDate)
 {
     //Trace.WriteLine("Creating " + Domain);
     this.Id            = Id;
     this.Domain        = Domain;
     this.ReferenceDate = ReferenceDate;
     Trusts             = new Dictionary <DomainKey, GraphEdge>();
 }
 public bool HasDomainAmbigiousName(DomainKey domainKey)
 {
     if (AmbigiousNameReference.ContainsKey(domainKey.DomainName))
     {
         return(AmbigiousNameReference[domainKey.DomainName].Count > 1);
     }
     return(true);
 }
Exemple #4
0
 public void SetForest(DomainKey forest)
 {
     // compatibility with older report without forest information
     if (String.IsNullOrEmpty(forest.DomainName))
     {
         return;
     }
     if (forest != null && Forest == null)
     {
         Forest = forest;
     }
 }
Exemple #5
0
        // SID is suppose to identify uniquely a domain
        // but we cannot guarantee that it is here (for example domain removed or firewalled)
        public GraphNode CreateNodeIfNeeded(ref int number, DomainKey Domain, string NetBiosName, DateTime ReferenceDate)
        {
            GraphNode output = null;

            if (!data.ContainsKey(Domain))
            {
                output       = new GraphNode(number++, Domain, NetBiosName, ReferenceDate);
                data[Domain] = output;
            }
            else
            {
                output = data[Domain];
            }
            return(output);
        }
        protected string PrintDomain(DomainKey key)
        {
            string label = key.DomainName;

            if (GetUrlCallback == null)
            {
                return(label);
            }
            string htmlData = GetUrlCallback(key, label);

            if (String.IsNullOrEmpty(htmlData))
            {
                return(label);
            }
            return(htmlData);
        }
Exemple #7
0
 public void EnrichForestInformation()
 {
     if (Forest != null)
     {
         return;
     }
     foreach (var trust in Trusts.Keys)
     {
         if ((Trusts[trust].TrustAttributes & 32) != 0)
         {
             if (Trusts[trust].Destination.Forest != null)
             {
                 Forest = Trusts[trust].Destination.Forest;
                 continue;
             }
         }
     }
 }
 public HealthcheckData GetDomain(DomainKey key)
 {
     if (key.DomainSID != null)
     {
         if (data.ContainsKey(key.DomainSID))
         {
             return(data[key.DomainSID]);
         }
         return(null);
     }
     foreach (HealthcheckData hc in data.Values)
     {
         if (String.Equals(hc.DomainFQDN, key.DomainName, StringComparison.InvariantCultureIgnoreCase))
         {
             return(hc);
         }
     }
     return(null);
 }
 private void UpdateAmbigiousReference(DomainKey domain)
 {
     if (domain == null || String.IsNullOrEmpty(domain.DomainSID) || String.IsNullOrEmpty(domain.DomainName))
     {
         return;
     }
     if (!AmbigiousNameReference.ContainsKey(domain.DomainName))
     {
         AmbigiousNameReference[domain.DomainName] = new List <string> {
             domain.DomainSID
         }
     }
     ;
     else if (!String.IsNullOrEmpty(domain.DomainSID))
     {
         if (!AmbigiousNameReference[domain.DomainName].Contains(domain.DomainSID))
         {
             AmbigiousNameReference[domain.DomainName].Add(domain.DomainSID);
         }
     }
 }
Exemple #10
0
        public GraphNode GetDomain(string center)
        {
            DomainKey key = new DomainKey(center, null, null);

            return(Locate(key));
        }