Пример #1
0
        private void cm_OnConnect(object sender, EventArgs e)
        {
            //check if we are joined to a domain -- if not, use simple bind
            uint requestedFields = (uint)Hostinfo.FieldBitmaskBits.FQ_HOSTNAME;

            //string domainFQDN = null;

            if (_hn == null)
            {
                _hn = new Hostinfo();
            }

            //TODO: kerberize eventlog, so that creds are meaningful.
            //for now, there's no reason to attempt single sign-on
            requestedFields |= (uint)Hostinfo.FieldBitmaskBits.FORCE_USER_PROMPT;


            if (_hn != null)
            {
                if (!_container.GetTargetMachineInfo(this, _hn, requestedFields))
                {
                    Logger.Log(
                        "Could not find information about target machine",
                        Logger.eventLogLogLevel);
                    if (eventLogHandle != null)
                    {
                        _hn.IsConnectionSuccess = true;
                    }
                }
                else
                {
                    if (_pluginNode != null && !String.IsNullOrEmpty(_hn.hostName))
                    {
                        logs = null;

                        if (eventLogHandle == null)
                        {
                            _container.ShowError("Unable to open the event log; eventlog server may be disabled");
                            _pluginNode.sc.ShowControl(_pluginNode);
                        }
                    }
                }
            }
        }