public ResultsLoaderProfile BuildResultsLoaderProfile()
        {
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add(new DataColumn("UserRange", typeof(UserRange)));
            dataTable.Columns.Add(new DataColumn("NameForFilter", typeof(string)));
            dataTable.Columns.Add(new DataColumn("DisplayNameForFilter", typeof(string)));
            dataTable.Columns.Add(new DataColumn("DomainController", typeof(string)));
            dataTable.Columns.Add(new DataColumn("Credential", typeof(PSCredential)));
            DataTable dataTable2 = ContactConfigurable.GetDataTable();

            dataTable2.Columns.Add(new DataColumn("UserPrincipalName", typeof(string)));
            dataTable2.Columns.Add(new DataColumn("SamAccountName", typeof(string)));
            DataColumn dataColumn = new DataColumn("LogonName", typeof(string));

            dataColumn.ExtendedProperties["LambdaExpression"] = "SamAccountName,DistinguishedName,Guid=>WinformsHelper.GenerateADObjectId(Guid(@0[\"Guid\"]),@0[DistinguishedName].ToString()).DomainId.Name + \"\\\" + @0[SamAccountName]";
            dataTable2.Columns.Add(dataColumn);
            ResultsColumnProfile[] displayedColumnCollection = new ResultsColumnProfile[]
            {
                new ResultsColumnProfile("City", false, Strings.CityColumnInPicker),
                new ResultsColumnProfile("Company", false, Strings.CompanyColumnInPicker),
                new ResultsColumnProfile("DisplayName", false, Strings.DisplayNameColumnInPicker),
                new ResultsColumnProfile("Department", false, Strings.DepartmentColumnInPicker),
                new ResultsColumnProfile("FirstName", false, Strings.FirstNameColumnInPicker),
                new ResultsColumnProfile("LastName", false, Strings.LastNameColumnInPicker),
                new ResultsColumnProfile("Manager", false, Strings.ManagerColumnInPicker),
                new ResultsColumnProfile("Office", false, Strings.OfficeColumnInPicker),
                new ResultsColumnProfile("Phone", false, Strings.PhoneColumnInPicker),
                new ResultsColumnProfile("StateOrProvince", false, Strings.StateOrProvinceColumnInPicker),
                new ResultsColumnProfile("Title", false, Strings.TitleColumnInPicker),
                new ResultsColumnProfile("Name", true, Strings.NameColumnInPicker),
                new ResultsColumnProfile("OrganizationalUnit", true, Strings.OUColumnInPicker)
            };
            ResultsLoaderProfile resultsLoaderProfile = new ResultsLoaderProfile(Strings.User, false, "RecipientTypeDetails", dataTable, dataTable2, displayedColumnCollection);

            resultsLoaderProfile.AddTableFiller(new ProcedureDataFiller("Get-User", new UserCommandBuilder
            {
                SearchType = 0,
                UseFilterToResolveNonId = true
            }));
            resultsLoaderProfile.HelpTopic = "Microsoft.Exchange.Management.SystemManager.WinForms.OrganizationalUnitPicker";
            return(resultsLoaderProfile);
        }
Exemple #2
0
        public ResultsLoaderProfile BuildResultsLoaderProfile()
        {
            ResultsColumnProfile resultsColumnProfile  = new ResultsColumnProfile("Name", true, Strings.Name);
            ResultsColumnProfile resultsColumnProfile2 = new ResultsColumnProfile("GroupType", true, Strings.GroupTypeColumnInPicker);
            ResultsLoaderProfile resultsLoaderProfile  = new ResultsLoaderProfile(Strings.Group, false, "RecipientTypeDetails", new DataTable(), ContactConfigurable.GetDataTable(), new ResultsColumnProfile[]
            {
                resultsColumnProfile,
                resultsColumnProfile2
            });
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["ResultSize"]           = "Unlimited";
            dictionary["RecipientTypeDetails"] = "UniversalDistributionGroup,UniversalSecurityGroup";
            resultsLoaderProfile.AddTableFiller(new MonadAdapterFiller("Get-Group", new ExchangeCommandBuilder
            {
                SearchType = 0
            })
            {
                Parameters = dictionary
            });
            resultsLoaderProfile.HelpTopic = "Microsoft.Exchange.Management.SystemManager.WinForms.UniversalGroupPicker";
            return(resultsLoaderProfile);
        }
        public ResultsLoaderProfile BuildResultsLoaderProfile()
        {
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add(new DataColumn("ExcludeObject", typeof(ADObjectId)));
            ResultsColumnProfile resultsColumnProfile  = new ResultsColumnProfile("DisplayName", true, Strings.DisplayNameColumnInPicker);
            ResultsColumnProfile resultsColumnProfile2 = new ResultsColumnProfile("Alias", true, Strings.AliasColumnInPicker);
            ResultsColumnProfile resultsColumnProfile3 = new ResultsColumnProfile("RecipientTypeDetails", true, Strings.RecipientTypeDetailsColumnInPicker);
            ResultsColumnProfile resultsColumnProfile4 = new ResultsColumnProfile("PrimarySmtpAddressToString", true, Strings.PrimarySmtpAddressColumnInPicker);
            ResultsLoaderProfile resultsLoaderProfile  = new ResultsLoaderProfile(Strings.RecipientUserOrContact, false, "RecipientTypeDetails", dataTable, ContactConfigurable.GetDataTable(), new ResultsColumnProfile[]
            {
                resultsColumnProfile,
                resultsColumnProfile2,
                resultsColumnProfile3,
                resultsColumnProfile4
            });

            resultsLoaderProfile.ScopeSupportingLevel = ScopeSupportingLevel.FullScoping;
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["ResultSize"]           = "Unlimited";
            dictionary["PropertySet"]          = "ConsoleSmallSet";
            dictionary["RecipientTypeDetails"] = "RemoteUserMailbox,RemoteRoomMailbox,RemoteEquipmentMailbox,RemoteSharedMailbox,MailUser,UserMailbox,LinkedMailbox,SharedMailbox,LegacyMailbox,RoomMailbox,EquipmentMailbox,MailContact,MailForestContact";
            resultsLoaderProfile.AddTableFiller(new MonadAdapterFiller("Get-Recipient", new ExchangeCommandBuilder(new ExcludeObjectFilterBuilder())
            {
                SearchType = 0
            })
            {
                Parameters = dictionary
            });
            resultsLoaderProfile.NameProperty = "DisplayName";
            resultsLoaderProfile.HelpTopic    = "Microsoft.Exchange.Management.SystemManager.WinForms.NonGroupRecipientsPicker";
            return(resultsLoaderProfile);
        }
        public virtual ResultsLoaderProfile BuildResultsLoaderProfile()
        {
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add(new DataColumn("ExcludeObject", typeof(ADObjectId)));
            ResultsColumnProfile resultsColumnProfile  = new ResultsColumnProfile("DisplayName", true, Strings.DisplayNameColumnInPicker);
            ResultsColumnProfile resultsColumnProfile2 = new ResultsColumnProfile("Alias", true, Strings.AliasColumnInPicker);
            ResultsColumnProfile resultsColumnProfile3 = new ResultsColumnProfile("RecipientTypeDetails", true, Strings.RecipientTypeDetailsColumnInPicker);
            ResultsColumnProfile resultsColumnProfile4 = new ResultsColumnProfile("PrimarySmtpAddressToString", true, Strings.PrimarySmtpAddressColumnInPicker);
            ResultsLoaderProfile resultsLoaderProfile  = new ResultsLoaderProfile(this.displayName, false, "RecipientTypeDetails", dataTable, ContactConfigurable.GetDataTable(), new ResultsColumnProfile[]
            {
                resultsColumnProfile,
                resultsColumnProfile2,
                resultsColumnProfile3,
                resultsColumnProfile4
            });

            resultsLoaderProfile.ScopeSupportingLevel = ScopeSupportingLevel.FullScoping;
            resultsLoaderProfile.WholeObjectProperty  = "WholeObjectProperty";
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["ResultSize"]  = "Unlimited";
            dictionary["PropertySet"] = "ConsoleSmallSet";
            StringBuilder stringBuilder = new StringBuilder();

            if (this.allowedNonGroups)
            {
                stringBuilder.Append(",RoomMailbox,EquipmentMailbox,LegacyMailbox,LinkedMailbox,UserMailbox,MailContact,MailForestContact,MailUser,RemoteUserMailbox,RemoteRoomMailbox,RemoteEquipmentMailbox,RemoteSharedMailbox,SharedMailbox");
            }
            if (this.allowedPublicFolder)
            {
                stringBuilder.Append(",PublicFolder");
            }
            if (this.allowedGroups)
            {
                stringBuilder.Append(",DynamicDistributionGroup,MailNonUniversalGroup,MailUniversalDistributionGroup,MailUniversalSecurityGroup");
            }
            stringBuilder.Remove(0, 1);
            dictionary["RecipientTypeDetails"] = stringBuilder.ToString();
            resultsLoaderProfile.AddTableFiller(new MonadAdapterFiller("Get-Recipient", new ExchangeCommandBuilder(new WithPrimarySmtpAddressRecipientFilterBuilder())
            {
                SearchType = 0
            })
            {
                Parameters = dictionary
            });
            resultsLoaderProfile.NameProperty = "DisplayName";
            resultsLoaderProfile.HelpTopic    = "Microsoft.Exchange.Management.SystemManager.WinForms.MerMailEnableRecipientConfigurable";
            return(resultsLoaderProfile);
        }
        public ResultsLoaderProfile BuildResultsLoaderProfile()
        {
            ResultsColumnProfile resultsColumnProfile = new ResultsColumnProfile("Name", true, Strings.Name);
            ResultsLoaderProfile resultsLoaderProfile = new ResultsLoaderProfile(Strings.Recipient, false, "RecipientTypeDetails", new DataTable(), ContactConfigurable.GetDataTable(), new ResultsColumnProfile[]
            {
                resultsColumnProfile
            });
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["ResultSize"] = "Unlimited";
            resultsLoaderProfile.AddTableFiller(new MonadAdapterFiller("Get-User", new ExchangeCommandBuilder
            {
                SearchType = 0
            })
            {
                Parameters = dictionary
            });
            dictionary = new Dictionary <string, string>();
            dictionary["ResultSize"] = "Unlimited";
            resultsLoaderProfile.AddTableFiller(new MonadAdapterFiller("Get-Group", new ExchangeCommandBuilder
            {
                SearchType = 0
            })
            {
                Parameters = dictionary
            });
            dictionary = new Dictionary <string, string>();
            dictionary["ResultSize"] = "Unlimited";
            resultsLoaderProfile.AddTableFiller(new MonadAdapterFiller("Get-Contact", new ExchangeCommandBuilder
            {
                SearchType = 0
            })
            {
                Parameters = dictionary
            });
            dictionary = new Dictionary <string, string>();
            dictionary["ResultSize"]           = "Unlimited";
            dictionary["PropertySet"]          = "ConsoleSmallSet";
            dictionary["RecipientTypeDetails"] = "PublicFolder,DynamicDistributionGroup";
            resultsLoaderProfile.AddTableFiller(new MonadAdapterFiller("Get-Recipient", new ExchangeCommandBuilder
            {
                SearchType = 0
            })
            {
                Parameters = dictionary
            });
            resultsLoaderProfile.HelpTopic = "Microsoft.Exchange.Management.SystemManager.WinForms.ExtendedRecipientsPicker";
            return(resultsLoaderProfile);
        }