예제 #1
0
        private List <ExchangeOrganizationDomain> GetOrganizationDomains(Runspace runSpace, string organizationId)
        {
            ExchangeLog.LogStart("Get-AcceptedDomain");

            Command cmd = new Command("Get-AcceptedDomain");

            cmd.Parameters.Add("Organization", organizationId);

            // run command
            Collection <PSObject> result = ExecuteShellCommand(runSpace, cmd);

            List <ExchangeOrganizationDomain> domains = new List <ExchangeOrganizationDomain>();

            foreach (PSObject objDomain in result)
            {
                ExchangeOrganizationDomain domain = new ExchangeOrganizationDomain();
                domain.Identity  = ObjToString(GetPSObjectProperty(objDomain, "Identity"));
                domain.Name      = (string)GetPSObjectProperty(objDomain, "Name");
                domain.IsDefault = (bool)GetPSObjectProperty(objDomain, "Default");
                domains.Add(domain);
            }

            ExchangeLog.LogEnd("Get-AcceptedDomain");
            return(domains);
        }
예제 #2
0
        private List<ExchangeOrganizationDomain> GetOrganizationDomains(Runspace runSpace, string organizationId)
        {
            ExchangeLog.LogStart("Get-AcceptedDomain");

            Command cmd = new Command("Get-AcceptedDomain");
            cmd.Parameters.Add("Organization", organizationId);

            // run command
            Collection<PSObject> result = ExecuteShellCommand(runSpace, cmd);

            List<ExchangeOrganizationDomain> domains = new List<ExchangeOrganizationDomain>();
            foreach (PSObject objDomain in result)
            {
                ExchangeOrganizationDomain domain = new ExchangeOrganizationDomain();
                domain.Identity = ObjToString(GetPSObjectProperty(objDomain, "Identity"));
                domain.Name = (string)GetPSObjectProperty(objDomain, "Name");
                domain.IsDefault = (bool)GetPSObjectProperty(objDomain, "Default");
                domains.Add(domain);
            }

            ExchangeLog.LogEnd("Get-AcceptedDomain");
            return domains;
        }