public PowerShellResults BlockDevice(Identity[] identities, BaseWebServiceParameters parameters)
        {
            PowerShellResults powerShellResults = new PowerShellResults();

            foreach (Identity identity in identities)
            {
                PowerShellResults <MobileDevice> @object = base.GetObject <MobileDevice>("Get-MobileDevice", identity);
                powerShellResults.MergeErrors <MobileDevice>(@object);
                if (@object.HasValue)
                {
                    MobileDevice value     = @object.Value;
                    Identity     identity2 = value.Id.Parent.Parent.ToIdentity();
                    PowerShellResults <CASMailbox> object2 = base.GetObject <CASMailbox>("Get-CASMailbox", identity2);
                    powerShellResults.MergeErrors <CASMailbox>(object2);
                    if (object2.HasValue)
                    {
                        MultiValuedProperty <string> activeSyncBlockedDeviceIDs = object2.Value.ActiveSyncBlockedDeviceIDs;
                        if (!activeSyncBlockedDeviceIDs.Contains(value.DeviceId))
                        {
                            activeSyncBlockedDeviceIDs.Add(value.DeviceId);
                            PSCommand psCommand = new PSCommand().AddCommand("Set-CASMailbox").AddParameter("Identity", identity2).AddParameter("ActiveSyncBlockedDeviceIDs", activeSyncBlockedDeviceIDs);
                            powerShellResults.MergeErrors(base.Invoke(psCommand));
                        }
                    }
                }
            }
            return(powerShellResults);
        }
示例#2
0
        public PowerShellResults StartLogging(Identity[] identities, BaseWebServiceParameters parameters)
        {
            PSCommand pscommand = new PSCommand().AddCommand("Set-CASMailbox");

            pscommand.AddParameter("Identity", Identity.FromExecutingUserId());
            pscommand.AddParameter("ActiveSyncDebugLogging", true);
            return(base.Invoke(pscommand));
        }
示例#3
0
        public PowerShellResults StopAndRetrieveLog(Identity[] identities, BaseWebServiceParameters parameters)
        {
            PSCommand pscommand = new PSCommand().AddCommand("Set-CASMailbox");

            pscommand.AddParameter("Identity", Identity.FromExecutingUserId());
            pscommand.AddParameter("ActiveSyncDebugLogging", false);
            PowerShellResults powerShellResults = base.Invoke(pscommand);
            PSCommand         psCommand         = new PSCommand().AddCommand("Get-MobileDeviceStatistics").AddParameter("GetMailboxLog", new SwitchParameter(true));

            return(powerShellResults.MergeErrors(base.Invoke(psCommand, identities, parameters)));
        }
        public PowerShellResults RemoveObjects(Identity[] identities, BaseWebServiceParameters parameters)
        {
            PSCommand psCommand = new PSCommand().AddCommand("Remove-Subscription");

            psCommand.AddParameters(new RemoveSubscription());
            PowerShellResults powerShellResults = base.RemoveObjects(psCommand, identities, parameters);

            if (powerShellResults != null && powerShellResults.Succeeded)
            {
                Util.NotifyOWAUserSettingsChanged(UserSettings.Mail);
            }
            return(powerShellResults);
        }
示例#5
0
        public PowerShellResults RemoveObjects(Identity[] identities, BaseWebServiceParameters parameters)
        {
            identities.FaultIfNullOrEmpty();
            Identity          groupIdentityForTranslation = DistributionGroupServiceBase.GetGroupIdentityForTranslation(identities);
            PowerShellResults powerShellResults           = new PowerShellResults();

            for (int i = 0; i < identities.Length; i++)
            {
                PSCommand         psCommand = new PSCommand().AddCommand("Remove-DistributionGroupMember").AddParameter("Identity", identities[i]);
                PowerShellResults results   = base.Invoke(psCommand, groupIdentityForTranslation, parameters);
                powerShellResults.MergeErrors(results);
            }
            return(powerShellResults);
        }
        public PowerShellResults RemoveObjects(Identity[] identities, BaseWebServiceParameters parameters)
        {
            PowerShellResults powerShellResults = new PowerShellResults();
            PowerShellResults <RetentionPolicyTagRow> powerShellResults2 = powerShellResults.MergeErrors <RetentionPolicyTagRow>(base.GetList <RetentionPolicyTagRow, AllAssociatedRPTsFilter>("Get-RetentionPolicyTag", new AllAssociatedRPTsFilter(), null));

            if (powerShellResults2.Failed)
            {
                return(powerShellResults);
            }
            PSCommand pscommand = new PSCommand().AddCommand("Set-RetentionPolicyTag");

            pscommand.AddParameter("Mailbox", RbacPrincipal.Current.ExecutingUserId);
            pscommand.AddParameter("OptionalInMailBox", (from x in powerShellResults2.Output
                                                         select x.Identity.RawIdentity).Except(from i in identities
                                                                                               select i.RawIdentity));
            powerShellResults.MergeErrors(base.Invoke(pscommand));
            return(powerShellResults);
        }
示例#7
0
 public PowerShellResults RemoveObjects(Identity[] identities, BaseWebServiceParameters parameters)
 {
     return(base.RemoveObjects("Remove-DistributionGroup", identities, parameters));
 }
示例#8
0
 public PowerShellResults RemoveObjects(Identity[] identities, BaseWebServiceParameters parameters)
 {
     return(base.RemoveObjects("Disable-UMMailbox", identities, parameters));
 }
示例#9
0
        public PowerShellResults <ForwardEmailMailbox> StopForward(Identity[] identities, BaseWebServiceParameters parameters)
        {
            SetForwardEmailMailbox setForwardEmailMailbox = new SetForwardEmailMailbox();

            setForwardEmailMailbox.ForwardingSmtpAddress = null;
            return(this.SetObject(identities[0], setForwardEmailMailbox));
        }
示例#10
0
 public PowerShellResults RemoveObjects(Identity[] identities, BaseWebServiceParameters wsParameters)
 {
     return(base.RemoveObjects("Remove-AcceptedDomain", identities, wsParameters));
 }
示例#11
0
 public PowerShellResults RemoveObjects(Identity[] identities, BaseWebServiceParameters parameters)
 {
     return(base.RemoveObjects("Remove-MobileDevice", identities, parameters));
 }
示例#12
0
 public PowerShellResults <MailboxSearchRow> StopSearch(Identity[] identities, BaseWebServiceParameters parameters)
 {
     return(base.InvokeAndGetObject <MailboxSearchRow>(new PSCommand().AddCommand("Stop-MailboxSearch"), identities, parameters));
 }
        public PowerShellResults RemoveObjects(Identity[] identities, BaseWebServiceParameters parameters)
        {
            Identity identity = identities.IsNullOrEmpty() ? null : ((Identity)((MailboxFolderPermissionIdentity)identities[0]).MailboxFolderId.ToMailboxFolderIdParameter());

            return(base.RemoveObjects("Remove-MailboxFolderPermission", identity, identities, "User", parameters));
        }
        public PowerShellResults <PimSubscriptionRow> ResendImapVerificationEmail(Identity[] identities, BaseWebServiceParameters parameters)
        {
            identities.FaultIfNotExactlyOne();
            SetImapSubscription setImapSubscription = new SetImapSubscription();

            setImapSubscription.ResendVerification = true;
            PowerShellResults <PimSubscriptionRow> powerShellResults = base.SetObject <ImapSubscription, SetImapSubscription, PimSubscriptionRow>("Set-ImapSubscription", identities[0], setImapSubscription);

            if (powerShellResults.Succeeded)
            {
                ImapSubscriptions imapSubscriptions          = new ImapSubscriptions();
                PowerShellResults <ImapSubscription> @object = imapSubscriptions.GetObject(identities[0]);
                if ([email protected])
                {
                    throw new FaultException(OwaOptionStrings.SubscriptionProcessingError);
                }
                string verificationFeedbackString = @object.Output[0].VerificationFeedbackString;
                if (verificationFeedbackString != null)
                {
                    powerShellResults.Informations = new string[]
                    {
                        verificationFeedbackString
                    };
                }
            }
            return(powerShellResults);
        }
示例#15
0
 public PowerShellResults <ExtensionRow> Enable(Identity[] identities, BaseWebServiceParameters parameters)
 {
     return(base.InvokeAndGetObject <ExtensionRow>(new PSCommand().AddCommand("Enable-App"), identities, parameters));
 }
示例#16
0
        public PowerShellResults <MobileDeviceRow> UnBlockOrCancelWipeDevice(Identity[] identities, BaseWebServiceParameters parameters)
        {
            PSCommand psCommand = new PSCommand().AddCommand("Clear-MobileDevice").AddParameter("Cancel", new SwitchParameter(true));

            return(base.InvokeAndGetObject <MobileDeviceRow>(psCommand, identities, parameters));
        }
示例#17
0
 public PowerShellResults RemoveObjects(Identity[] identities, BaseWebServiceParameters parameters)
 {
     return(base.RemoveObjects("Remove-ActiveSyncDeviceAccessRule", identities, parameters));
 }
示例#18
0
 public PowerShellResults RemoveObjects(Identity[] identities, BaseWebServiceParameters parameters)
 {
     return(base.RemoveObjects("Remove-RoleAssignmentPolicy", identities, parameters));
 }
示例#19
0
 public PowerShellResults <JournalRuleRow> DisableRule(Identity[] identities, BaseWebServiceParameters parameters)
 {
     return(base.InvokeAndGetObject <JournalRuleRow>(new PSCommand().AddCommand("Disable-JournalRule"), identities, parameters));
 }