Beispiel #1
0
 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 ADRecipientOrAddress ToADRecipientOrAddress(this ADIdParameter identity)
        {
            Participant participant = new Participant(identity.ToString(), identity.ToString(), "SMTP");

            return(new ADRecipientOrAddress(participant));
        }
        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);
        }