/// <summary>
        /// Attempts to check specified Certification Authority's management interfaces availability.
        /// </summary>
        /// <param name="computerName">CA's computer host name. Can be either short (NetBIOS) or fully qualified (FQDN) name.</param>
        /// <exception cref="ArgumentNullException">If the <strong>computerName</strong> parameter is null or empty.</exception>
        /// <returns><strong>True</strong> if management interfaces are available and accessible, otherwise <strong>False</strong>.</returns>
        public static Boolean Ping(String computerName)
        {
            if (String.IsNullOrEmpty(computerName))
            {
                throw new ArgumentNullException(nameof(computerName));
            }

            CertAdm.CertSrvIsServerOnline(computerName, out Boolean online);
            return(online);
        }
Exemple #2
0
        /// <summary>
        /// Attempts to check Certification Authority's management interfaces availability.
        /// </summary>
        /// <exception cref="UninitializedObjectException">The <see cref="CertificateAuthority"/> object is not
        /// initialized through a class constructor.</exception>
        /// <returns><strong>True</strong> if management interfaces are available and accessible, otherwise <strong>False</strong>.</returns>
        /// <remarks>
        /// The caller must have at least <strong>Read</strong> permissions on the CA server to ping management interfaces.
        /// Otherwise the method always returns <strong>False</strong>, regardles of actual interface state.
        /// </remarks>
        public Boolean Ping()
        {
            if (String.IsNullOrEmpty(ComputerName))
            {
                throw new UninitializedObjectException();
            }
            Boolean online = false;

            CertAdm.CertSrvIsServerOnline(ComputerName, ref online);
            return(online);
        }
        /// <summary>
        /// Attempts to check specified Certification Authority's management interfaces availability.
        /// </summary>
        /// <param name="computerName">CA's computer host name. Can be either short (NetBIOS) or fully qualified (FQDN) name.</param>
        /// <exception cref="ArgumentNullException">If the <strong>computerName</strong> parameter is null or empty.</exception>
        /// <returns><strong>True</strong> if management interfaces are available and accessible, otherwise <strong>False</strong>.</returns>
        public static Boolean Ping(String computerName)
        {
            if (String.IsNullOrEmpty(computerName))
            {
                throw new ArgumentNullException("computerName");
            }
            Boolean online = false;

            CertAdm.CertSrvIsServerOnline(computerName, ref online);
            return(online);
        }