public PowerShellResults <SmsOptions> SetObject(Identity identity, SetSmsOptions properties) { properties.FaultIfNull(); identity = Identity.FromExecutingUserId(); if (!string.IsNullOrEmpty(properties.VerificationCode)) { PSCommand pscommand = new PSCommand(); pscommand.AddCommand("Compare-TextMessagingVerificationCode"); pscommand.AddParameter("VerificationCode", properties.VerificationCode); PowerShellResults results = base.Invoke(pscommand, new Identity[] { identity }, new BaseWebServiceParameters { ShouldContinue = properties.ShouldContinue }); PowerShellResults <SmsOptions> @object = this.GetObject(identity); @object.MergeErrors(results); return(@object); } if (!string.IsNullOrEmpty(properties.CountryCode) && !string.IsNullOrEmpty(properties.NotificationPhoneNumber) && !properties.NotificationPhoneNumber.StartsWith(properties.CountryCode)) { properties.NotificationPhoneNumber = properties.CountryCode + properties.NotificationPhoneNumber; } return(base.SetObject <SmsOptions, SetSmsOptions>("Set-TextMessagingAccount", identity, properties)); }
public PowerShellResults <GetVoiceMailConfiguration> SetObject(Identity identity, SetVoiceMailConfiguration properties) { properties.FaultIfNull(); identity = Identity.FromExecutingUserId(); PowerShellResults <GetVoiceMailConfiguration> powerShellResults = new PowerShellResults <GetVoiceMailConfiguration>(); PowerShellResults <GetVoiceMailConfiguration> @object = this.GetObject(identity); powerShellResults.MergeErrors <GetVoiceMailConfiguration>(@object); if (powerShellResults.Failed) { return(powerShellResults); } powerShellResults.MergeErrors <UMMailboxPin>(base.SetObject <UMMailboxPin, SetVoiceMailPIN>("Set-UMMailboxPIN", identity, properties.SetVoiceMailPIN)); if (powerShellResults.Failed) { return(powerShellResults); } properties.ReturnObjectType = ReturnObjectTypes.Full; powerShellResults.MergeAll(base.SetObject <GetVoiceMailConfiguration, SetVoiceMailConfiguration>("Set-UMMailbox", identity, properties)); if (powerShellResults.SucceededWithValue) { GetVoiceMailConfiguration value = powerShellResults.Value; RbacPrincipal.Current.RbacConfiguration.ExecutingUserIsUmConfigured = value.IsConfigured; if (this.IsPhoneVerified(value.PhoneNumber, value) && !string.IsNullOrEmpty(properties.PhoneProviderId)) { PowerShellResults <SmsOptions> results = this.SetTextMessagingAccount(identity, value.PhoneNumber, value.PhoneProviderId, value); powerShellResults.MergeErrors <SmsOptions>(results); } } return(powerShellResults); }
public PowerShellResults <ProtocolSettingsData> GetObject(Identity identity) { PSCommand pscommand = new PSCommand().AddCommand("Get-CasMailbox"); pscommand.AddParameter("ProtocolSettings", true); return(base.GetObject <ProtocolSettingsData>(pscommand, Identity.FromExecutingUserId())); }
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)); }
public PowerShellResults ResetPIN(Identity identity) { PSCommand pscommand = new PSCommand().AddCommand("Set-UMMailboxPIN"); pscommand.AddParameter("Identity", Identity.FromExecutingUserId()); pscommand.AddParameter("PinExpired", true); return(base.Invoke(pscommand)); }
public PowerShellResults SendLog(CalendarDiagnosticLog properties) { PSCommand pscommand = new PSCommand().AddCommand("Get-CalendarDiagnosticLog"); pscommand.AddParameter("Identity", Identity.FromExecutingUserId()); pscommand.AddParameters(properties); return(base.Invoke(pscommand)); }
private void OnDeserializing(StreamingContext streamingContext) { this.Identity = ((RbacPrincipal.Current.ExecutingUserId != null) ? Identity.FromExecutingUserId() : null); if (base.CanSetParameter("ByPassDelegateChecking")) { base["BypassDelegateChecking"] = true; } }
public static Identity GetGroupIdentityForTranslation(Identity[] identities) { if (identities.Length != 1) { return(Identity.FromExecutingUserId()); } return(identities[0]); }
public PowerShellResults ProcessUpload(DLPPolicyUploadParameters parameters) { parameters.FaultIfNull(); if (parameters is DLPNewPolicyUploadParameters) { return(base.Invoke(new PSCommand().AddCommand("New-DLPPolicy"), Identity.FromExecutingUserId(), parameters)); } return(null); }
public PowerShellResults <Account> GetObject(Identity identity) { bool flag = identity != null; identity = (identity ?? Identity.FromExecutingUserId()); PowerShellResults <Account> @object = base.GetObject <Account>("Get-Mailbox", identity); if (@object.SucceededWithValue) { @object.Value.IsProfilePage = this.IsProfilePage; PowerShellResults <User> powerShellResults = @object.MergeErrors <User>(base.GetObject <User>("Get-User", identity)); if (powerShellResults.SucceededWithValue) { @object.Value.OrgPersonObject = powerShellResults.Value; if (RbacPrincipal.Current.IsInRole("MultiTenant+Mailbox+Get-MailboxStatistics?Identity@R:Organization") || (this.IsProfilePage && RbacPrincipal.Current.IsInRole("Mailbox+Get-MailboxStatistics?Identity@R:Self"))) { PowerShellResults <MailboxStatistics> object2 = base.GetObject <MailboxStatistics>("Get-MailboxStatistics", identity, false); if (object2.SucceededWithValue) { @object.Value.Statistics = object2.Value; } } if (@object.Value.IsRoom && RbacPrincipal.Current.IsInRole("Get-CalendarProcessing?Identity@R:Organization")) { PowerShellResults <CalendarConfiguration> powerShellResults2 = @object.MergeErrors <CalendarConfiguration>(base.GetObject <CalendarConfiguration>("Get-CalendarProcessing", identity, false)); if (powerShellResults2.SucceededWithValue) { @object.Value.CalendarConfiguration = powerShellResults2.Value; } } if (RbacPrincipal.Current.IsInRole("Get-SupervisionListEntry?Identity@R:Organization")) { SupervisionListEntryFilter filter = new SupervisionListEntryFilter { Identity = identity, Tag = null }; PowerShellResults <SupervisionListEntryRow> powerShellResults3 = @object.MergeErrors <SupervisionListEntryRow>(base.GetList <SupervisionListEntryRow, SupervisionListEntryFilter>("Get-SupervisionListEntry", filter, null)); if (powerShellResults3.Succeeded) { @object.Value.AllowedSenders = this.GetStringsWithTag(powerShellResults3.Output, "allow"); @object.Value.BlockedSenders = this.GetStringsWithTag(powerShellResults3.Output, "reject"); } } } if (RbacPrincipal.Current.IsInRole("Get-CasMailbox?Identity@R:Organization") || (!flag && RbacPrincipal.Current.IsInRole("Get-CasMailbox?Identity@R:Self"))) { PowerShellResults <CASMailbox> powerShellResults4 = @object.MergeErrors <CASMailbox>(base.GetObject <CASMailbox>("Get-CasMailbox", identity, false)); if (powerShellResults4.SucceededWithValue) { @object.Value.CasMailbox = powerShellResults4.Value; } } } return(@object); }
public PowerShellResults <O> SetObject <O, U>(Identity identity, U properties) where O : ResourceConfigurationBase where U : SetResourceConfigurationBase { identity = Identity.FromExecutingUserId(); PowerShellResults <O> result; lock (RbacPrincipal.Current.OwaOptionsLock) { result = base.SetObject <O, U>("Set-CalendarProcessing", identity, properties); } return(result); }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); this.image = this.FindImage(this, "imgUserPhoto"); Identity identity = Identity.FromExecutingUserId(); foreach (PopupLauncher popupLauncher in this.GetVisibleControls <PopupLauncher>(this)) { popupLauncher.NavigationUrl = EcpUrl.AppendQueryParameter(popupLauncher.NavigationUrl, "id", identity.RawIdentity); } }
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 <SupervisionStatus> GetObject(Identity identity) { identity = Identity.FromExecutingUserId(); if (RbacPrincipal.Current.IsInRole("Get-SupervisionPolicy?DisplayDetails")) { PSCommand pscommand = new PSCommand(); pscommand.AddCommand("Get-SupervisionPolicy"); pscommand.AddParameter("DisplayDetails"); return(base.GetObject <SupervisionStatus>(pscommand, identity)); } return(base.GetObject <SupervisionStatus>("Get-SupervisionPolicy", identity)); }
protected override void BuildScriptDescriptor(ScriptComponentDescriptor descriptor) { base.BuildScriptDescriptor(descriptor); Identity dataContract = Identity.FromExecutingUserId(); Image image = (Image)this.Parent.FindControl(this.ImageElementId); descriptor.AddElementProperty("Image", image.ClientID); descriptor.AddComponentProperty("CancelWebServiceMethod", this.CancelWebServiceMethod.ClientID); descriptor.AddComponentProperty("SaveWebServiceMethod", this.SaveWebServiceMethod.ClientID); descriptor.AddComponentProperty("RemoveWebServiceMethod", this.RemoveWebServiceMethod.ClientID); descriptor.AddScriptProperty("ObjectIdentity", dataContract.ToJsonString(null)); descriptor.AddProperty("RemovingPreviewPhotoText", this.RemovingPreviewPhotoText); }
public PowerShellResults <SupervisionStatus> SetObject(Identity identity, SetSupervisionStatus properties) { identity = Identity.FromExecutingUserId(); properties.FaultIfNull(); PowerShellResults <SupervisionStatus> powerShellResults = new PowerShellResults <SupervisionStatus>(); powerShellResults.MergeErrors <SupervisionStatus>(base.SetObject <SupervisionStatus, SetSupervisionStatus>("Set-SupervisionPolicy", identity, properties)); if (powerShellResults.Failed) { return(powerShellResults); } powerShellResults.MergeAll(base.SetObject <SupervisionStatus, SetClosedCampusOutboundPolicyConfiguration>("Set-SupervisionPolicy", identity, properties.MyClosedCampusOutboundPolicyConfiguration)); return(powerShellResults); }
public PowerShellResults <O> SetObject <O, U>(Identity identity, U properties) where O : MessagingConfigurationBase where U : SetMessagingConfigurationBase { identity = Identity.FromExecutingUserId(); PowerShellResults <O> powerShellResults; lock (RbacPrincipal.Current.OwaOptionsLock) { powerShellResults = base.SetObject <O, U>("Set-MailboxMessageConfiguration", identity, properties); if (powerShellResults != null && powerShellResults.Succeeded) { Util.NotifyOWAUserSettingsChanged(UserSettings.Mail); } } return(powerShellResults); }
public PowerShellResults <CalendarWorkflowConfiguration> SetObject(Identity identity, SetCalendarWorkflowConfiguration properties) { identity = Identity.FromExecutingUserId(); PowerShellResults <CalendarWorkflowConfiguration> powerShellResults; lock (RbacPrincipal.Current.OwaOptionsLock) { powerShellResults = base.SetObject <CalendarWorkflowConfiguration, SetCalendarWorkflowConfiguration>("Set-CalendarProcessing", identity, properties); } if (powerShellResults != null && powerShellResults.Succeeded) { Util.NotifyOWAUserSettingsChanged(UserSettings.Calendar); } return(powerShellResults); }
public PowerShellResults <SendAddressConfiguration> SetObject(Identity identity, SetSendAddressDefaultConfiguration properties) { identity = Identity.FromExecutingUserId(); PowerShellResults <SendAddressConfiguration> powerShellResults; lock (RbacPrincipal.Current.OwaOptionsLock) { powerShellResults = base.SetObject <SendAddressConfiguration, SetSendAddressDefaultConfiguration>("Set-MailboxMessageConfiguration", identity, properties); } if (powerShellResults.Succeeded) { Util.NotifyOWAUserSettingsChanged(UserSettings.Mail); } return(powerShellResults); }
public PowerShellResults <SmsOptions> DisableObject(Identity identity) { identity = Identity.FromExecutingUserId(); PSCommand pscommand = new PSCommand(); pscommand.AddCommand("Clear-TextMessagingAccount"); PowerShellResults results = base.Invoke(pscommand, new Identity[] { identity }, null); PowerShellResults <SmsOptions> @object = this.GetObject(identity); @object.MergeErrors(results); return(@object); }
public PowerShellResults <CalendarNotificationSettings> GetObject(Identity identity) { identity = Identity.FromExecutingUserId(); PowerShellResults <CalendarNotificationSettings> @object = base.GetObject <CalendarNotificationSettings>("Get-CalendarNotification", identity); if ([email protected] && @object.HasValue) { PowerShellResults <SmsOptions> powerShellResults = @object.MergeErrors <SmsOptions>(base.GetObject <SmsOptions>("Get-TextMessagingAccount", identity)); if (powerShellResults.HasValue) { @object.Value.NotificationEnabled = powerShellResults.Value.NotificationEnabled; @object.Value.EasEnabled = powerShellResults.Value.EasEnabled; } } return(@object); }
public PowerShellResults <CalendarWorkflowConfiguration> UpdateObject(Identity identity) { identity = Identity.FromExecutingUserId(); SetCalendarWorkflowConfiguration setCalendarWorkflowConfiguration = new SetCalendarWorkflowConfiguration(); setCalendarWorkflowConfiguration.AutomateProcessing = CalendarProcessingFlags.AutoUpdate.ToString(); PowerShellResults <CalendarWorkflowConfiguration> powerShellResults; lock (RbacPrincipal.Current.OwaOptionsLock) { powerShellResults = base.SetObject <CalendarWorkflowConfiguration, SetCalendarWorkflowConfiguration>("Set-CalendarProcessing", identity, setCalendarWorkflowConfiguration); } if (powerShellResults != null && powerShellResults.Succeeded) { Util.NotifyOWAUserSettingsChanged(UserSettings.Calendar); } return(powerShellResults); }
public PowerShellResults <CalendarAppearanceConfiguration> UpdateObject(Identity identity) { identity = Identity.FromExecutingUserId(); SetCalendarAppearanceConfiguration setCalendarAppearanceConfiguration = new SetCalendarAppearanceConfiguration(); setCalendarAppearanceConfiguration.WorkingHoursTimeZone = ((RbacPrincipal.Current.UserTimeZone == null) ? ExTimeZone.CurrentTimeZone.Id : RbacPrincipal.Current.UserTimeZone.Id); PowerShellResults <CalendarAppearanceConfiguration> powerShellResults; lock (RbacPrincipal.Current.OwaOptionsLock) { powerShellResults = base.SetObject <CalendarAppearanceConfiguration, SetCalendarAppearanceConfiguration>("Set-MailboxCalendarConfiguration", identity, setCalendarAppearanceConfiguration); } if (powerShellResults != null && powerShellResults.Succeeded) { Util.NotifyOWAUserSettingsChanged(UserSettings.Calendar); } return(powerShellResults); }
internal ReducedRecipient GetRecipientObject(Identity identity) { Identity identity2 = identity; ReducedRecipient result = null; if (null == identity2 && RbacPrincipal.Current.ExecutingUserId != null) { identity2 = Identity.FromExecutingUserId(); } if (null != identity2) { PowerShellResults <MailboxRecipientRow> @object = base.GetObject <MailboxRecipientRow>("Get-Recipient", identity2, false); if (@object.SucceededWithValue) { result = @object.Value.Recipient; } } return(result); }
public PowerShellResults <RegionalSettingsConfiguration> GetObject(Identity identity) { identity = Identity.FromExecutingUserId(); PowerShellResults <RegionalSettingsConfiguration> settings = this.GetSettings(identity, true); if (settings.SucceededWithValue) { if (settings.Value.UserCulture == null) { settings.Value.MailboxRegionalConfiguration.Language = Culture.GetDefaultCulture(HttpContext.Current); } PowerShellResults <MailboxCalendarConfiguration> powerShellResults = settings.MergeErrors <MailboxCalendarConfiguration>(base.GetObject <MailboxCalendarConfiguration>("Get-MailboxCalendarConfiguration", identity)); if (powerShellResults.SucceededWithValue) { settings.Value.MailboxCalendarConfiguration = powerShellResults.Value; } } return(settings); }
public PowerShellResults <GetVoiceMailConfiguration> GetObject(Identity identity) { identity = Identity.FromExecutingUserId(); PowerShellResults <GetVoiceMailConfiguration> @object = base.GetObject <GetVoiceMailConfiguration>("Get-UMMailbox", identity); if (@object.SucceededWithValue) { PowerShellResults <SmsOptions> object2 = base.GetObject <SmsOptions>("Get-TextMessagingAccount", identity); @object.MergeErrors <SmsOptions>(object2); if (object2.SucceededWithValue) { @object.Value.SmsOptions = object2.Value; } } else if (@object.Failed && @object.ErrorRecords[0].Exception is ManagementObjectNotFoundException) { @object.ErrorRecords = new ErrorRecord[0]; } return(@object); }
public PowerShellResults <GetVoiceMailConfiguration> RegisterPhone(Identity identity, SetVoiceMailConfiguration properties) { properties.FaultIfNull(); identity = Identity.FromExecutingUserId(); PowerShellResults <GetVoiceMailConfiguration> @object = this.GetObject(identity); if (@object.Failed || string.IsNullOrEmpty(properties.PhoneNumber)) { return(@object); } GetVoiceMailConfiguration value = @object.Value; value.VerificationCodeRequired = !this.IsPhoneVerified(properties.PhoneNumber, value); if (string.IsNullOrEmpty(properties.PhoneProviderId)) { properties.PhoneProviderId = value.PhoneProviderId; } if (value.VerificationCodeRequired) { if (!string.IsNullOrEmpty(properties.VerificationCode)) { @object.MergeErrors(this.ComparePasscode(identity, properties.VerificationCode)); value.VerificationCodeRequired = [email protected]; } else { PowerShellResults <SmsOptions> powerShellResults = this.SetTextMessagingAccount(identity, properties.PhoneNumber, properties.PhoneProviderId, value); @object.MergeErrors <SmsOptions>(powerShellResults); if (powerShellResults.SucceededWithValue) { value.SmsOptions = powerShellResults.Value; value.VerificationCodeRequired = !powerShellResults.Value.NotificationPhoneNumberVerified; if (value.VerificationCodeRequired) { @object.MergeErrors(this.SendVerificationCode(identity)); } } } } return(this.ClearOutputOnFailure(@object)); }
public PowerShellResults <SmsOptions> SendVerificationCode(Identity identity, SetSmsOptions properties) { properties.FaultIfNull(); identity = Identity.FromExecutingUserId(); properties.VerificationCode = null; PowerShellResults <SmsOptions> powerShellResults = this.SetObject(identity, properties); if (!powerShellResults.Failed) { PSCommand pscommand = new PSCommand(); pscommand.AddCommand("Send-TextMessagingVerificationCode"); PowerShellResults results = base.Invoke(pscommand, new Identity[] { identity }, new BaseWebServiceParameters { ShouldContinue = properties.ShouldContinue }); powerShellResults.MergeErrors(results); } return(powerShellResults); }
public PowerShellResults <SendAddressConfiguration> GetObject(Identity identity) { identity = Identity.FromExecutingUserId(); PowerShellResults <SendAddressConfiguration> @object = base.GetObject <SendAddressConfiguration>("Get-MailboxMessageConfiguration", identity); if (@object.Failed) { return(@object); } SendAddress sendAddress = new SendAddress(); PowerShellResults <SendAddressRow> list = sendAddress.GetList(new SendAddressFilter { AddressId = (@object.Value.SendAddressDefault ?? string.Empty), IgnoreNullOrEmpty = false }, null); if (list.Failed) { @object.MergeErrors <SendAddressRow>(list); return(@object); } @object.Value.SendAddressDefault = list.Value.Value; return(@object); }
public PowerShellResults <RegionalSettingsConfiguration> SetObject(Identity identity, SetRegionalSettingsConfiguration properties) { properties.FaultIfNull(); identity = Identity.FromExecutingUserId(); PowerShellResults <RegionalSettingsConfiguration> powerShellResults = null; bool flag = CultureInfo.CurrentCulture.LCID != properties.Language; properties.ReturnObjectType = ReturnObjectTypes.Full; lock (RbacPrincipal.Current.OwaOptionsLock) { powerShellResults = base.SetObject <RegionalSettingsConfiguration, SetRegionalSettingsConfiguration>("Set-MailboxRegionalConfiguration", identity, properties); } if (powerShellResults != null && powerShellResults.SucceededWithValue) { LocalSession.Current.AddRegionalSettingsToCache(powerShellResults.Value); if (HttpContext.Current.IsExplicitSignOn()) { LocalSession.Current.UpdateUserTimeZone(powerShellResults.Value.TimeZone); } else { LocalSession.Current.UpdateRegionalSettings(powerShellResults.Value); if (flag) { LocalSession.Current.RbacConfiguration.ExecutingUserLanguagesChanged = true; HttpContext.Current.Response.Cookies.Add(new HttpCookie("mkt", powerShellResults.Value.UserCulture.Name) { HttpOnly = false }); } } UserSettings userSettings = flag ? UserSettings.RegionAndLanguage : UserSettings.RegionWithoutLanguage; Util.NotifyOWAUserSettingsChanged(userSettings); } return(powerShellResults); }