Talk About Network

Google





Software > Biz Talk Admin > remote WMI exe...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 548 of 555
Post > Topic >>

remote WMI execution

by =?Utf-8?B?QVY=?= <AV@[EMAIL PROTECTED] > Apr 17, 2008 at 02:12 AM

Hi,

I am writing a win application which can monitor the status of BizTalk 
HostInstances across all the environments. I plan to host this winapp onto
a 
centralized server within the same domain as my BizTalk servers are for 
different environments.

I am unable to get the HostInstances's name from a remote biztalk server
in 
the same domain whereas it works fine for a local one. Below is the peice
of 
code which I am executing to get the HostInstance names.

CODE
---------------
ConnectionOptions _conOpt = new ConnectionOptions();
            _conOpt.Impersonation = ImpersonationLevel.Impersonate;
            _conOpt.Authentication = AuthenticationLevel.Default;
            _conOpt.EnablePrivileges = true;
            
            _conOpt.Username = @[EMAIL PROTECTED]
"MYDOMAIN\myadminusername";
            _conOpt.Password = "mypassword";
            
            EnumerationOptions _enumOpt = new EnumerationOptions();
            
            ManagementScope _mgmtScope = new ManagementScope();
            _mgmtScope.Path = new 
ManagementPath("\\\\my.remote.biztalkservername\\ROOT\\MICROSOFTBIZTALKSERVER");
            _mgmtScope.Options = _conOpt;

            try
            {
                _mgmtScope.Connect();

                ManagementObjectSearcher _mgmtObjSrch = new 
ManagementObjectSearcher(_mgmtScope, new ObjectQuery("SELECT * FROM 
MSBTS_HostInstance"));
                ManagementObjectCollection _mgmtObjCol =
_mgmtObjSrch.Get();

                foreach (ManagementObject _hiObj in _mgmtObjCol)
                {
                    string _strTemp = 
_hiObj.Properties["Name"].Value.ToString();
                    DialogResult _diagRes = MessageBox.Show(_strTemp + "
YOU 
WISH TO STOP THIS SERVICE ??", "UserOption", MessageBoxButtons.YesNo);
                    if (_diagRes.Equals(DialogResult.Yes))
                    {
                        _hiObj.InvokeMethod("Stop", null);
                    }
                }
            }
            catch (Exception ex)
            {
                
MessageBox.Show(ex.Message,"ERROR",MessageBoxButtons.OK,MessageBoxIcon.Error);
            }

The following error is returned when trying to retreive the HostInstance 
name from a remote BizTalk server.

ERROR
---------------------------
BizTalk Server cannot access SQL server.  This could be due to one of the 
following reasons:
1. Access permissions have been denied to the current user.  Either log on

as a user that has been granted permissions to SQL and try again, or grant

the current user permission to access SQL Server.
2. The SQL Server does not exist or an invalid database name has been 
specified.  Check the name entered for the SQL Server and database to make

sure they are correct as provided during SQL Server installation.
3. The SQL Server exists, but is not currently running.  Use the Windows 
Service Control Manager or SQL Enterprise Manager to start SQL Server, and

try again.
4. A SQL database file with the same name as the specified database
already 
exists in the Microsoft SQL Server data folder.

Internal error from OLEDB provider: "Login failed for user 'NT 
AUTHORITY\ANONYMOUS LOGON'."


Please help !!

Tks,
 




 1 Posts in Topic:
remote WMI execution
=?Utf-8?B?QVY=?= <AV@[  2008-04-17 02:12:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Thu Jan 8 22:36:39 PST 2009.