private ADUser TryObjectId() { ADObjectId adObjectId = null; if (ADObjectId.TryParseDnOrGuid(this.userId, out adObjectId)) { return(this.session.FindADUserByObjectId(adObjectId)); } return(null); }
private string GetUMFilter() { string result = "(UMEnabled -eq 'true')"; if (this.DialPlanIdentity != null) { ADObjectId adobjectId; if (!ADObjectId.TryParseDnOrGuid(this.DialPlanIdentity.RawIdentity, out adobjectId)) { throw new FaultException(new ArgumentException(this.DialPlanIdentity.RawIdentity, "DialPlanIdentity").Message); } adobjectId = ADSystemConfigurationObjectIDResolver.Instance.ResolveObject(adobjectId); if (adobjectId != null) { result = string.Format("(UMEnabled -eq 'true') -and (UMRecipientDialPlanId -eq '{0}')", adobjectId.DistinguishedName); } } return(result); }
protected ADIdParameter(string identity) { if (identity == null) { throw new ArgumentNullException("identity"); } if (identity.Length == 0) { throw new ArgumentException(Strings.ErrorEmptyParameter(base.GetType().ToString()), "identity"); } identity = this.TryResolveRedactedPii(identity); ADObjectId adobjectId; if (ADObjectId.TryParseDnOrGuid(identity, out adobjectId) && !adobjectId.IsRelativeDn) { this.Initialize(adobjectId); } this.rawIdentity = identity; }
protected override void InternalValidate() { TaskLogger.LogEnter(); base.InternalValidate(); if (base.HasErrors) { return; } if (base.Fields.IsModified("AddedMembers") && this.AddedMembers != null && this.AddedMembers.Count > 0) { foreach (RecipientWithAdUserGroupIdParameter <RecipientIdParameter> recipientWithAdUserGroupIdParameter in this.AddedMembers) { ADObjectId memberid; if (!ADObjectId.TryParseDnOrGuid(recipientWithAdUserGroupIdParameter.RawIdentity, out memberid) || !MailboxTaskHelper.GroupContainsMember(this.DataObject, memberid, base.TenantGlobalCatalogSession)) { MailboxTaskHelper.ValidateAndAddMember(base.TenantGlobalCatalogSession, this.DataObject, recipientWithAdUserGroupIdParameter, false, new Task.ErrorLoggerDelegate(base.WriteError), new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <ADRecipient>)); } } } if (base.Fields.IsModified("RemovedMembers") && this.RemovedMembers != null && this.RemovedMembers.Count > 0) { foreach (RecipientWithAdUserGroupIdParameter <RecipientIdParameter> recipientWithAdUserGroupIdParameter2 in this.RemovedMembers) { ADObjectId memberid2; if (!ADObjectId.TryParseDnOrGuid(recipientWithAdUserGroupIdParameter2.RawIdentity, out memberid2) || MailboxTaskHelper.GroupContainsMember(this.DataObject, memberid2, base.TenantGlobalCatalogSession)) { MailboxTaskHelper.ValidateAndRemoveMember(base.TenantGlobalCatalogSession, this.DataObject, recipientWithAdUserGroupIdParameter2, this.Identity.RawIdentity, false, new Task.TaskErrorLoggingDelegate(base.WriteError), new DataAccessHelper.GetDataObjectDelegate(base.GetDataObject <ADRecipient>)); } } } if (this.RawMembers != null && this.RawMembers.IsChangesOnlyCopy) { this.UpdateMembersWhenRawMembersChanged(); } TaskLogger.LogExit(); }