Exemple #1
0
        public bool IsRebootRequired(string host)
        {
            bool isRequired = false;

            string key = @"SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\";
            //para Windows 2012 e 2012 R2 a chave de registro é diferente
            string subKey = "RebootRequired";

            //Verifica se o Servidor local é Windows 2008, isso porque o Remote Registry não consegue abrir
            //As chaves de registro de Update
            if (IsLocalServerWin2008())
            {
                throw new Exception("Local Operation System cannot open Remote Registry. Try to run in another source server.");
            }

            RegUtils reg = new RegUtils(host);

            //Checa para Windows
            if (reg.GetKeyValue(key, subKey) != null)
            {
                isRequired = true;
            }

            return(isRequired);
        }
Exemple #2
0
        private bool CheckIsRebootRequiredViaDCOM(string host, string key, string subKey)
        {
            bool isRequired = false;

            RegUtils reg = new RegUtils(host);

            //Checa para Windows
            if (reg.GetKeyValue(key, subKey) != null)
            {
                isRequired = true;
            }

            return(isRequired);
        }