Пример #1
0
        internal Domain[] GetDomains(string[] domainNames)
        {
            Debug.Assert(m_settings.HasDomainManagerService);

            using (DomainManagerClient client = m_settings.DomainManagerService.CreateDomainManagerClient())
            {
                return(client.GetDomains(domainNames, EntityStatus.Enabled));
            }
        }
Пример #2
0
        public static Domain GetDomain(this DomainManagerClient client, string domainName, EntityStatus?status)
        {
            if (string.IsNullOrEmpty(domainName))
            {
                throw new ArgumentException("value was null or empty", "domainName");
            }

            Domain[] domains = client.GetDomains(new string[] { domainName }, status);
            if (domains.IsNullOrEmpty())
            {
                return(null);
            }

            return(domains[0]);
        }