none
WMI Script for Accesing Biztalk Instance Details RRS feed

  • Question

  • Hi,

    I am using the below code to count no.of instances are suspended/dehydrated in Biztalk Server. It is working fine in my local system. But not in another system.

    Code 

     

    string query = "SELECT * FROM MSBTS_ServiceInstance where ServiceStatus = 4 OR ServiceStatus = 8 OR ServiceStatus = 32";

    ManagementObjectSearcher searcherServiceInstance = new ManagementObjectSearcher(

                    new ManagementScope("root\\MicrosoftBizTalkServer"), new WqlObjectQuery(query), null);

    int nNumSvcInstFound = searcherServiceInstance.Get().Count;

     

    Error

    System.Runtime.InteropServices.COMException was unhandled by user code

      Message="Login failed for user 'Domain\\BIZ001$'."

      Source="WinMgmt"

      ErrorCode=-2146232060

      StackTrace:

           at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)

           at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()

           at System.Management.ManagementObjectCollection.get_Count()

           at MSMQ_MsgTransfer_Service.MSMQMessageTransferService.timerObj_Elapsed(Object sender, ElapsedEventArgs e) in C:\BizTalk Projects\MSMQ_MsgTransfer_Service\MSMQ_MsgTransfer_Service\Service1.cs:line 47

           at System.Timers.Timer.MyTimerCallback(Object state)

     

    Please advice, is there any permission required to do WMI operations.

     

    Thanks,

    Lakshmi



    Thursday, July 29, 2010 11:35 AM

Answers

All replies