예제 #1
0
        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)));
        }
예제 #4
0
        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);
        }
예제 #6
0
        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));
        }
예제 #14
0
        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));
 }