Ejemplo n.º 1
0
        /// <summary>
        /// Determines whether this computer is a server as determined by the OS.
        /// </summary>
        /// <returns><c>true</c> if this computer is a server; otherwise, <c>false</c>.</returns>
        public bool IsServer()
        {
            if (IsDomainController())
            {
                return(true);
            }

            // Samba servers do not report their OS, so it is customary to put the server in a
            // special OU.
            if (DistinguishedName.IndexOf(",OU=SAMBA", StringComparison.InvariantCultureIgnoreCase) >= 0)
            {
                return(true);
            }

            if (OperatingSystem.IndexOf("SERVER", StringComparison.InvariantCultureIgnoreCase) >= 0)
            {
                return(true);
            }

            return(false);
        }