public PowerShellResults <MailboxFolder> GetList(MailboxFolderFilter filter, SortOptions sort)
        {
            PowerShellResults <MailboxFolder> list = base.GetList <MailboxFolder, MailboxFolderFilter>("Get-MailboxFolder", filter, sort, "Name");

            if (list.Succeeded)
            {
                list.Output = this.LinkFolders(list.Output, filter.FolderPickerType);
            }
            return(list);
        }
 protected PowerShellResults <L> GetList <L, F>(PSCommand psCommand, F filter, SortOptions sort, string defaultSortProperty) where F : WebServiceParameters, new()
 {
     if (string.IsNullOrEmpty(defaultSortProperty))
     {
         throw new FaultException(new ArgumentNullException("defaultSortProperty").Message);
     }
     if (sort == null)
     {
         sort              = new SortOptions();
         sort.Direction    = SortDirection.Ascending;
         sort.PropertyName = defaultSortProperty;
     }
     return(this.GetList <L, F>(psCommand, filter, sort));
 }
Beispiel #3
0
        private RecipientStatusRow[] CreateRecipientStatusRows(RecipientTrackingEvent[] recipientTrackingEvents)
        {
            int num = recipientTrackingEvents.Length;

            RecipientStatusRow[] array = new RecipientStatusRow[num];
            for (int i = 0; i < num; i++)
            {
                array[i] = new RecipientStatusRow(base.Identity, recipientTrackingEvents[i]);
            }
            if (array.Length > 0)
            {
                Func <RecipientStatusRow[], RecipientStatusRow[]> sortFunction = new SortOptions
                {
                    PropertyName = "RecipientDeliveryStatus"
                }.GetSortFunction <RecipientStatusRow>();
                array = sortFunction(array);
            }
            return(array);
        }
Beispiel #4
0
        public PowerShellResults <OptionalRetentionPolicyTagRow> GetList(AllRPTsFilter filter, SortOptions sort)
        {
            PowerShellResults <OptionalRetentionPolicyTagRow> powerShellResults = new PowerShellResults <OptionalRetentionPolicyTagRow>();
            PowerShellResults <OptionalRetentionPolicyTagRow> list = base.GetList <OptionalRetentionPolicyTagRow, AllRPTsFilter>("Get-RetentionPolicyTag", filter, sort, "DisplayName");
            PowerShellResults <OptionalRetentionPolicyTagRow> powerShellResults2 = list.MergeErrors <OptionalRetentionPolicyTagRow>(base.GetList <OptionalRetentionPolicyTagRow, AllAssociatedRPTsFilter>("Get-RetentionPolicyTag", new AllAssociatedRPTsFilter(), null));

            if (list.Succeeded && powerShellResults2.Succeeded)
            {
                powerShellResults.Output = list.Output.Except(powerShellResults2.Output).ToArray <OptionalRetentionPolicyTagRow>();
                if (RbacPrincipal.Current.ExecutingUserId != null)
                {
                    Accounts accounts = new Accounts();
                    if (!RetentionUtils.UserHasArchive(accounts.GetRecipientObject(null)))
                    {
                        List <OptionalRetentionPolicyTagRow> list2 = new List <OptionalRetentionPolicyTagRow>();
                        foreach (OptionalRetentionPolicyTagRow optionalRetentionPolicyTagRow in powerShellResults.Output)
                        {
                            if (optionalRetentionPolicyTagRow.RetentionPolicyTag.RetentionAction != RetentionActionType.MoveToArchive)
                            {
                                list2.Add(optionalRetentionPolicyTagRow);
                            }
                        }
                        powerShellResults.Output = list2.ToArray();
                    }
                }
                if (sort != null)
                {
                    sort.PropertyName = RetentionPolicyTagBaseRow.GetSortProperty(sort.PropertyName);
                    Func <OptionalRetentionPolicyTagRow[], OptionalRetentionPolicyTagRow[]> sortFunction = sort.GetSortFunction <OptionalRetentionPolicyTagRow>();
                    if (sortFunction != null)
                    {
                        powerShellResults.Output = sortFunction(powerShellResults.Output);
                    }
                }
            }
            return(powerShellResults);
        }
 public PowerShellResults <DeletedMailboxRow> GetList(DeletedMailboxFilter filter, SortOptions sort)
 {
     return(base.GetList <DeletedMailboxRow, DeletedMailboxFilter>("Get-RemovedMailbox", filter, sort, "DeletionDate"));
 }
 public PowerShellResults <RuleRow> GetList(UMCallAnsweringRuleFilter filter, SortOptions sort)
 {
     return(base.GetList <RuleRow, UMCallAnsweringRuleFilter>("Get-UMCallAnsweringRule", filter, sort));
 }
Beispiel #7
0
        public PowerShellResults <UMDialingRuleGroupRow> GetList(UMDialPlanFilterWithIdentity filter, SortOptions sort)
        {
            PowerShellResults <UMDialingRuleGroupRow> powerShellResults = new PowerShellResults <UMDialingRuleGroupRow>();

            filter.FaultIfNull();
            filter.DialPlanIdentity.FaultIfNull();
            PowerShellResults <UMDialPlanObjectWithGroupList> @object = base.GetObject <UMDialPlanObjectWithGroupList>("Get-UMDialPlan", filter.DialPlanIdentity);

            powerShellResults.MergeErrors <UMDialPlanObjectWithGroupList>(@object);
            if (@object.SucceededWithValue)
            {
                if (filter.IsInternational)
                {
                    powerShellResults.Output = (from dialGroupName in @object.Value.ConfiguredInternationalGroupNameList
                                                select new UMDialingRuleGroupRow(dialGroupName)).ToArray <UMDialingRuleGroupRow>();
                }
                else
                {
                    powerShellResults.Output = (from dialGroupName in @object.Value.ConfiguredInCountryOrRegionGroupNameList
                                                select new UMDialingRuleGroupRow(dialGroupName)).ToArray <UMDialingRuleGroupRow>();
                }
            }
            return(powerShellResults);
        }
        public PowerShellResults <DeviceClassPickerObject> GetList(DeviceClassPickerFilter filter, SortOptions sort)
        {
            if (!string.IsNullOrEmpty(filter.DeviceType))
            {
                filter.Filter = string.Format("DeviceType -eq '{0}'", filter.DeviceType);
            }
            PowerShellResults <DeviceClassPickerObject> list = base.GetList <DeviceClassPickerObject, DeviceClassPickerFilter>("Get-ActiveSyncDeviceClass", filter, sort);

            if (filter.GroupDeviceType)
            {
                List <DeviceClassPickerObject> list2 = new List <DeviceClassPickerObject>();
                list2.Add(new DeviceClassPickerObject(DeviceClassPickerObject.AllDeviceTypeQueryString, DeviceClassPickerObject.AllDeviceModelQueryString));
                HashSet <string> hashSet = new HashSet <string>();
                foreach (DeviceClassPickerObject deviceClassPickerObject in list.Output)
                {
                    if (!hashSet.Contains(deviceClassPickerObject.DeviceType.QueryString))
                    {
                        list2.Add(deviceClassPickerObject);
                        hashSet.Add(deviceClassPickerObject.DeviceType.QueryString);
                    }
                }
                list.Output = list2.ToArray();
            }
            else if (!string.IsNullOrEmpty(filter.DeviceType))
            {
                List <DeviceClassPickerObject> list3 = new List <DeviceClassPickerObject>();
                list3.Add(new DeviceClassPickerObject(new DeviceAccessRuleQueryString
                {
                    QueryString = filter.DeviceType
                }, DeviceClassPickerObject.AllDeviceModelQueryString));
                list3.AddRange(list.Output);
                list.Output = list3.ToArray();
            }
            return(list);
        }
Beispiel #9
0
 public PowerShellResults <MailboxPlan> GetList(MailboxPlanFilter filter, SortOptions sort)
 {
     return(base.GetList <MailboxPlan, MailboxPlanFilter>("Get-MailboxPlan", filter, sort));
 }
        public PowerShellResults <ManagementRoleRow> GetList(ManagementRoleFilter filter, SortOptions sort)
        {
            PowerShellResults <ManagementRoleRow> list = base.GetList <ManagementRoleRow, ManagementRoleFilter>("Get-ManagementRole", filter, sort, "Name");

            list.Output = Array.FindAll <ManagementRoleRow>(list.Output, (ManagementRoleRow x) => !x.IsEndUserRole);
            return(list);
        }
Beispiel #11
0
        public PowerShellResults <EndUserRoleRow> GetList(ManagementRoleFilter filter, SortOptions sort)
        {
            PowerShellResults <EndUserRoleRow> list = base.GetList <EndUserRoleRow, ManagementRoleFilter>("Get-ManagementRole", filter, sort);

            if (!list.Succeeded)
            {
                return(list);
            }
            list.Output = Array.FindAll <EndUserRoleRow>(list.Output, (EndUserRoleRow x) => x.IsEndUserRole);
            if (Util.IsDataCenter && filter != null && filter.Policy != null)
            {
                PowerShellResults <RoleAssignmentPolicy> result = EndUserRoles.policyService.GetObject(filter.Policy);
                if (result.HasValue)
                {
                    bool flag = (from role in list.Output
                                 where !string.IsNullOrEmpty(role.MailboxPlanIndex)
                                 select role).Count <EndUserRoleRow>() > 0;
                    if (flag)
                    {
                        list.Output = (from role in list.Output
                                       where string.IsNullOrEmpty(role.MailboxPlanIndex) || role.MailboxPlanIndex == result.Value.MailboxPlanIndex
                                       select role).ToArray <EndUserRoleRow>();
                    }
                }
                else
                {
                    list.Output = new EndUserRoleRow[0];
                }
            }
            return(list);
        }
        public PowerShellResults <AdminAuditLogResultRow> GetList(ExternalAccessFilter filter, SortOptions sort)
        {
            filter.ExternalAccess = new bool?(true);
            PowerShellResults <AdminAuditLogResultRow> list = base.GetList <AdminAuditLogResultRow, ExternalAccessFilter>("Search-AdminAuditLog", filter, sort);

            if (list.Succeeded)
            {
                PowerShellResults <AdminAuditLogResultRow> powerShellResults = new PowerShellResults <AdminAuditLogResultRow>();
                int num = list.Output.Length;
                AdminAuditLogResultRow[] array = new AdminAuditLogResultRow[num];
                for (int i = 0; i < num; i++)
                {
                    string text = string.Format("{0};{1};{2};{3}", new object[]
                    {
                        list.Output[i].AuditReportSearchBaseResult.ObjectModified,
                        list.Output[i].AuditReportSearchBaseResult.CmdletName,
                        filter.StartDate,
                        filter.EndDate
                    });
                    Identity id = new Identity(text, text);
                    array[i] = new AdminAuditLogResultRow(id, list.Output[i].AuditReportSearchBaseResult);
                }
                powerShellResults.Output = array;
                return(powerShellResults);
            }
            return(list);
        }
        public PowerShellResults <ManagementScopeRow> GetList(ManagementScopeFilter filter, SortOptions sort)
        {
            PowerShellResults <ManagementScopeRow> list = base.GetList <ManagementScopeRow, ManagementScopeFilter>("Get-ManagementScope", filter, null, "Name");

            if (list.Succeeded)
            {
                ManagementScopeRow[]      output = list.Output;
                List <ManagementScopeRow> list2  = new List <ManagementScopeRow>(output.Length + 1);
                list2.Add(ManagementScopeRow.DefaultRow);
                list2.AddRange(output);
                list.Output = list2.ToArray();
            }
            return(list);
        }
Beispiel #14
0
 public PowerShellResults <DistributionGroupRow> GetList(DistributionGroupFilter filter, SortOptions sort)
 {
     return(base.GetList <DistributionGroupRow, DistributionGroupFilter>("Get-Recipient", filter, sort));
 }
Beispiel #15
0
        public PowerShellResults <SubscriptionItem> GetList(SubscriptionItemFilter filter, SortOptions sort)
        {
            PowerShellResults <SubscriptionItem> list = base.GetList <SubscriptionItem, SubscriptionItemFilter>("Get-Subscription", filter, sort);

            if (list.Output != null && list.Output.Length > 0)
            {
                list.Output = Array.FindAll <SubscriptionItem>(list.Output, (SubscriptionItem x) => x.IsValid);
            }
            return(list);
        }
Beispiel #16
0
        public PowerShellResults <SupervisionTag> GetList(TransportConfigFilter filter, SortOptions sort)
        {
            PowerShellResults <SupervisionTag>           powerShellResults  = new PowerShellResults <SupervisionTag>();
            PowerShellResults <TransportConfigContainer> powerShellResults2 = powerShellResults.MergeErrors <TransportConfigContainer>(base.GetList <TransportConfigContainer, TransportConfigFilter>("Get-TransportConfig", filter, sort));

            if (powerShellResults2.HasValue)
            {
                string[] array = powerShellResults2.Value.SupervisionTags.ToArray();
                if (array != null && array.Length > 0)
                {
                    SupervisionTag[] array2 = new SupervisionTag[array.Length];
                    for (int i = 0; i < array.Length; i++)
                    {
                        array2[i] = new SupervisionTag(array[i]);
                    }
                    powerShellResults.Output = array2;
                }
            }
            return(powerShellResults);
        }
Beispiel #17
0
 public PowerShellResults <ExtensionRow> GetList(ExtensionFilter filter, SortOptions sort)
 {
     return(base.GetList <ExtensionRow, ExtensionFilter>("Get-App", filter, sort));
 }
Beispiel #18
0
 public new PowerShellResults <RecipientPickerObject> GetList(AdminPickerFilter filter, SortOptions sort)
 {
     return(base.GetList(filter, sort));
 }
Beispiel #19
0
 public PowerShellResults <SendAddressRow> GetList(SendAddressFilter filter, SortOptions sort)
 {
     return(base.GetList <SendAddressRow, SendAddressFilter>("Get-SendAddress", filter, sort));
 }
        protected PowerShellResults <L> GetList <L, F>(string getCmdlet, F filter, SortOptions sort) where F : WebServiceParameters, new()
        {
            PSCommand psCommand = new PSCommand().AddCommand(getCmdlet);

            return(this.GetList <L, F>(psCommand, filter, sort));
        }
        public PowerShellResults <AdminAuditLogResultRow> GetList(AdminAuditLogSearchFilter filter, SortOptions sort)
        {
            if (filter == null)
            {
                filter = new AdminAuditLogSearchFilter();
            }
            filter.Cmdlets    = "Set-Mailbox";
            filter.Parameters = "LitigationHoldEnabled";
            if (filter != null && filter.ObjectIds != null && filter.ObjectIds.Length > 0)
            {
                SmtpAddress[] addresses = filter.ObjectIds.ToSmtpAddressArray();
                string[]      identitiesFromSmtpAddresses = AuditHelper.GetIdentitiesFromSmtpAddresses(addresses);
                if (identitiesFromSmtpAddresses.Length != 0)
                {
                    filter.ObjectIds = string.Join(",", identitiesFromSmtpAddresses);
                }
            }
            PowerShellResults <AdminAuditLogResultRow> list = base.GetList <AdminAuditLogResultRow, AdminAuditLogSearchFilter>("Search-AdminAuditLog", filter, sort);
            PowerShellResults <AdminAuditLogResultRow> powerShellResults = new PowerShellResults <AdminAuditLogResultRow>();

            if (list.Succeeded)
            {
                string a = null;
                foreach (AdminAuditLogResultRow adminAuditLogResultRow in list.Output)
                {
                    if (!string.Equals(a, adminAuditLogResultRow.ObjectModified, StringComparison.InvariantCultureIgnoreCase))
                    {
                        a = adminAuditLogResultRow.ObjectModified;
                        powerShellResults.MergeOutput(new AdminAuditLogResultRow[]
                        {
                            adminAuditLogResultRow
                        });
                    }
                }
                int num = powerShellResults.Output.Length;
                AdminAuditLogResultRow[] array = new AdminAuditLogResultRow[num];
                for (int j = 0; j < num; j++)
                {
                    Identity id = AuditHelper.CreateIdentity(powerShellResults.Output[j].ObjectModified, filter.StartDate, filter.EndDate);
                    array[j] = new AdminAuditLogResultRow(id, powerShellResults.Output[j].AuditReportSearchBaseResult);
                }
                powerShellResults.Output = array;
                return(powerShellResults);
            }
            return(list);
        }
        public PowerShellResults <RecipientStatusRow> GetList(RecipientTrackingEventsFilter filter, SortOptions sort)
        {
            PowerShellResults <MessageTrackingReportRow> list = base.GetList <MessageTrackingReportRow, RecipientTrackingEventsFilter>("Get-MessageTrackingReport", filter, null);
            PowerShellResults <RecipientStatusRow>       powerShellResults = new PowerShellResults <RecipientStatusRow>();

            powerShellResults.MergeErrors <MessageTrackingReportRow>(list);
            if (list.SucceededWithValue)
            {
                powerShellResults.Output = list.Value.RecipientStatuses;
            }
            else
            {
                powerShellResults.Output = new RecipientStatusRow[0];
            }
            if (sort != null && powerShellResults.Output.Length > 1)
            {
                Func <RecipientStatusRow[], RecipientStatusRow[]> sortFunction = sort.GetSortFunction <RecipientStatusRow>();
                powerShellResults.Output = sortFunction(powerShellResults.Output);
            }
            return(powerShellResults);
        }
 public PowerShellResults <SupervisionListEntryRow> GetList(SupervisionListEntryFilter filter, SortOptions sort)
 {
     filter.Identity = Identity.FromExecutingUserId();
     return(base.GetList <SupervisionListEntryRow, SupervisionListEntryFilter>("Get-SupervisionListEntry", filter, sort));
 }
Beispiel #24
0
 public PowerShellResults <RoleAssignmentPolicyRow> GetList(RoleAssignmentPolicyFilter filter, SortOptions sort)
 {
     return(base.GetList <RoleAssignmentPolicyRow, RoleAssignmentPolicyFilter>("Get-RoleAssignmentPolicy", filter, sort));
 }
        protected PowerShellResults <L> GetList <L, F>(PSCommand psCommand, F filter, SortOptions sort) where F : WebServiceParameters, new()
        {
            EcpPerfCounters.WebServiceGetList.Increment();
            Func <L[], L[]> func = (sort != null) ? sort.GetSortFunction <L>() : null;
            F f;

            if ((f = filter) == null)
            {
                f = Activator.CreateInstance <F>();
            }
            filter = f;
            PowerShellResults <L> powerShellResults = this.CoreInvoke <L>(psCommand, null, null, filter);

            if (func != null)
            {
                powerShellResults.Output = func(powerShellResults.Output);
            }
            ResultSizeFilter resultSizeFilter = filter as ResultSizeFilter;

            if (resultSizeFilter != null && powerShellResults.HasWarnings)
            {
                for (int i = 0; i < powerShellResults.Warnings.Length; i++)
                {
                    if (powerShellResults.Warnings[i] == Strings.WarningMoreResultsAvailable || powerShellResults.Warnings[i] == Strings.WarningDefaultResultSizeReached(resultSizeFilter.ResultSize.ToString()))
                    {
                        powerShellResults.Warnings[i] = ClientStrings.ListViewMoreResultsWarning;
                    }
                }
            }
            return(powerShellResults);
        }
Beispiel #26
0
        public PowerShellResults <JsonDictionary <object> > GetList(DDIParameters filter, SortOptions sort)
        {
            MethodInfo method = this.ServiceType.GetMethod("GetList", new Type[]
            {
                typeof(DDIParameters),
                typeof(SortOptions)
            });

            return((PowerShellResults <JsonDictionary <object> >)method.Invoke(this.ServiceInstance, new object[]
            {
                filter,
                sort
            }));
        }
Beispiel #27
0
        public PowerShellResults <UMCallSummaryReportRow> GetList(UMCallSummaryReportFilter filter, SortOptions sort)
        {
            bool isExportCallDataEnabled = false;

            if (filter != null && string.Equals(filter.GroupBy, GroupBy.Day.ToString()))
            {
                isExportCallDataEnabled = true;
            }
            PowerShellResults <UMCallSummaryReportRow> list = base.GetList <UMCallSummaryReportRow, UMCallSummaryReportFilter>("Get-UMCallSummaryReport", filter, sort);

            if (list.Succeeded)
            {
                foreach (UMCallSummaryReportRow umcallSummaryReportRow in list.Output)
                {
                    umcallSummaryReportRow.IsExportCallDataEnabled = isExportCallDataEnabled;
                    umcallSummaryReportRow.UMDialPlanID            = filter.UMDialPlan;
                    umcallSummaryReportRow.UMIPGatewayID           = filter.UMIPGateway;
                }
            }
            return(list);
        }
Beispiel #28
0
        public PowerShellResults <MobileDeviceRow> GetList(MobileDeviceFilter filter, SortOptions sort)
        {
            PSCommand psCommand = new PSCommand().AddCommand("Get-CASMailbox").AddParameter("ActiveSyncDebugLogging", new SwitchParameter(true));
            PowerShellResults <CASMailbox> @object = base.GetObject <CASMailbox>(psCommand, (filter == null) ? Identity.FromExecutingUserId() : filter.Mailbox);
            bool isLoggingRunning = false;

            if (@object.HasValue)
            {
                isLoggingRunning = @object.Value.ActiveSyncDebugLogging;
            }
            PowerShellResults <MobileDeviceRow> list = base.GetList <MobileDeviceRow, MobileDeviceFilter>("Get-MobileDeviceStatistics", filter, sort);

            if (@object.HasValue)
            {
                foreach (MobileDeviceRow mobileDeviceRow in list.Output)
                {
                    mobileDeviceRow.IsLoggingRunning = isLoggingRunning;
                }
            }
            return(list);
        }
Beispiel #29
0
        public PowerShellResults <EndUserRoleRow> GetAssignedEndUserRoles(RoleAssignmentPolicyFilter filter, SortOptions sort)
        {
            PowerShellResults <RoleAssignmentPolicy> @object           = this.GetObject(filter.Policy);
            PowerShellResults <EndUserRoleRow>       powerShellResults = new PowerShellResults <EndUserRoleRow>
            {
                ErrorRecords = @object.ErrorRecords,
                Warnings     = @object.Warnings
            };

            if (@object.SucceededWithValue)
            {
                EndUserRoles endUserRoles = new EndUserRoles();
                powerShellResults.MergeAll(endUserRoles.GetList(null, null));
                if (powerShellResults.Succeeded)
                {
                    List <EndUserRoleRow> list = new List <EndUserRoleRow>();
                    foreach (EndUserRoleRow endUserRoleRow in powerShellResults.Output)
                    {
                        if (@object.Value.AssignedEndUserRoles.Contains(endUserRoleRow.Identity))
                        {
                            list.Add(endUserRoleRow);
                        }
                    }
                    powerShellResults.Output = list.ToArray();
                }
            }
            return(powerShellResults);
        }
Beispiel #30
0
 public PowerShellResults <RmsTemplate> GetList(RmsTemplateFilter filter, SortOptions sort)
 {
     return(base.GetList <RmsTemplate, RmsTemplateFilter>("Get-RMSTemplate", filter, sort));
 }