public static QueryFilter GetFilter(string identity) { ADObjectId propertyValue; if (ADIdParameter.TryResolveCanonicalName(identity, out propertyValue)) { new ComparisonFilter(ComparisonOperator.Equal, ADObjectSchema.Id, propertyValue); } return(null); }
public void Append(string parameterName, ADIdParameter parameterValue) { this.InitializeIfNeeded(); if (parameterValue != null && !string.IsNullOrEmpty(parameterValue.RawIdentity)) { this.stringBuilder.Append(string.Concat(new string[] { " -", parameterName, ":'", parameterValue.RawIdentity, "'" })); } }
protected T GetUniqueADObject <T>(ADIdParameter idParameter, IConfigDataProvider provider, bool throwWhenMissing) where T : ADObject, new() { T t = default(T); foreach (T t2 in idParameter.GetObjects <T>(null, provider)) { if (t != null) { base.WriteError(new ManagementObjectAmbiguousException(Strings.ErrorManagementObjectAmbiguous(idParameter.ToString())), ErrorCategory.InvalidArgument, null); } t = t2; } if (t == null && throwWhenMissing) { base.WriteError(new ManagementObjectNotFoundException(Strings.ErrorManagementObjectNotFound(idParameter.ToString())), ErrorCategory.InvalidArgument, null); } return(t); }
public static ADRecipientOrAddress ToADRecipientOrAddress(this ADIdParameter identity) { Participant participant = new Participant(identity.ToString(), identity.ToString(), "SMTP"); return(new ADRecipientOrAddress(participant)); }
internal static bool SiteEquals(ADObjectId siteId, ADIdParameter inputSite) { return(siteId != null && inputSite != null && (siteId.Name.Equals(inputSite.ToString(), StringComparison.OrdinalIgnoreCase) || siteId.ToString().Equals(inputSite.ToString(), StringComparison.OrdinalIgnoreCase) || (inputSite.InternalADObjectId != null && inputSite.InternalADObjectId.Equals(siteId)))); }
public static T ResolvePolicyObject <T>(Task task, IConfigDataProvider session, ADIdParameter idParameter) where T : IConfigurable, new() { T result = default(T); IEnumerable <T> objects = idParameter.GetObjects <T>(null, session); using (IEnumerator <T> enumerator = objects.GetEnumerator()) { if (enumerator.MoveNext()) { result = enumerator.Current; if (enumerator.MoveNext()) { task.WriteError(new ManagementObjectAmbiguousException(Strings.ErrorAmbiguousPolicyIdentity(idParameter.RawIdentity)), ErrorCategory.SyntaxError, idParameter); } } else { task.WriteError(new ManagementObjectNotFoundException(Strings.ErrorPolicyNotFound(idParameter.RawIdentity)), ErrorCategory.ObjectNotFound, idParameter); } } return(result); }
internal void SetPolicyId(ADIdParameter policyId) { this.PolicyId = policyId; }
protected HygieneFilterRule(TransportRule transportRule, string name, int priority, RuleState state, string comments, TransportRulePredicate[] conditions, TransportRulePredicate[] exceptions, ADIdParameter policyId) : base(transportRule) { if (transportRule == null) { base.Name = name; } this.Priority = priority; this.State = state; this.Comments = comments; this.conditions = conditions; this.exceptions = exceptions; this.PolicyId = policyId; }