public void ExecuteCmdletBase(PSCmdlet callingCmdlet)
        {
            ManagementService client = CreateManagementServiceClient();
            var relyingParties = client.RelyingParties;

            List<string> relyingPartyNames = new List<string>();

            foreach (var relyingParty in relyingParties)
            {
                string name = relyingParty.Name;
                relyingPartyNames.Add(name);
            }

            callingCmdlet.WriteObject(relyingPartyNames, true);
        }
示例#2
0
        public void ExecuteCmdletBase(PSCmdlet callingCmdlet)
        {
            if (Domain == null)
            {
                callingCmdlet.WriteWarning("No valid domain has been provided.");

                return;
            }

            if (!Domain.CheckIsValid())
            {
                callingCmdlet.WriteWarning("An invalid domain object has been provided.");

                return;
            }

            Model.IDatabaseInfo dbInfo = Domain;

            using (MappingToolDatabaseDataContext dataContext = new MappingToolDatabaseDataContext(dbInfo.ConnectionString))
            {
                dataContext.CommandTimeout = 180;
                if (MapId != Guid.Empty)
                {
                    /// Find maps by ID.
                    /// 

                    Model.Map map = GetMapById(dataContext, MapId);

                    callingCmdlet.WriteObject(map);
                }
                else if (!string.IsNullOrEmpty(MapName))
                {
                    /// Find maps by name.
                    /// 

                    List<Model.Map> maps = GetMapsByName(dataContext, MapName);

                    callingCmdlet.WriteObject(maps, true);
                }
                else
                {
                    /// Fine all maps.
                    /// 

                    List<Model.Map> maps = GetAllMaps(dataContext);

                    callingCmdlet.WriteObject(maps, true);
                }
            }
        }
        public void ExecuteCmdletBase(PSCmdlet callingCmdlet)
        {
            ManagementService client = CreateManagementServiceClient();
            var relyingParties = client.RelyingParties;

            List<string> relyingPartyRelayAddresses = new List<string>();

            long relyingPartyId = -1;

            foreach (var relyingParty in relyingParties)
            {
                string name = relyingParty.Name;

                if (name == RelyingParty)
                {
                    relyingPartyId = relyingParty.Id;
                }
            }

            foreach (RelyingPartyAddress address in client.RelyingPartyAddresses)
            {
                if (address.RelyingPartyId == relyingPartyId)
                {
                    relyingPartyRelayAddresses.Add(address.Address);
                }
            }

            callingCmdlet.WriteObject(relyingPartyRelayAddresses, true); ;
        }
示例#4
0
        public void ExecuteCmdletBase(PSCmdlet callingCmdlet)
        {
            using (MappingToolDatabaseDataContext dataContext = new MappingToolDatabaseDataContext(ConnectionString))
            {
                dataContext.CommandTimeout = 180;
                if (DomainId != Guid.Empty)
                {
                    /// Find domains by domain ID.
                    /// 

                    Model.Domain domain = GetDomainById(dataContext, DomainId);

                    callingCmdlet.WriteObject(domain);
                }
                else if (!string.IsNullOrEmpty(DomainName))
                {
                    /// Find domains by domain name.
                    /// 

                    List<Model.Domain> domains = GetDomainsByName(dataContext, DomainName);

                    callingCmdlet.WriteObject(domains, true);
                }
                else
                {
                    /// Find all domains.
                    /// 

                    List<Model.Domain> domains = GetAllDomains(dataContext);

                    callingCmdlet.WriteObject(domains, true);
                }
            }
        }