Host Instance / WMI.. can’t get it working

Home Page Forums BizTalk 2004 – BizTalk 2010 Host Instance / WMI.. can’t get it working

Viewing 2 reply threads
  • Author
    Posts
    • #16249

      Hi.

       I'm trying to write some VBS/WMI scripts that (among other thing) is supposed to
        1- Enabled an instance that is disabled
        2- Start it up.

      While i can start an instance, I'm not able to Enable it.

      Script sample

      Query = "SELECT * FROM MSBTS_HostInstance WHERE HostName =""" & HostName & """ AND RunningServer = """ & FailoverServerName & """"
      Set ObjWMIService = GetObject("winmgmts://./root/MicrosoftBizTalkServer")
      Set InstSet2 = objWMIService.ExecQuery(Query)

      if InstSet2.Count > 0 Then
       For Each Inst2 In InstSet2
        If 4 <> Inst2.ServiceState Then
         Inst2.IsDisabled=False
         Inst2.Start
        endif 
       next
      end if

      If I run this script, the Start method always fails with error "Instance disabled". as per MSDN doc, I made sure than the instances of the host are stopped before amending, but stil no luck.

      Funny bit is that echo the properties .isdisabled after setting will return false, but .start method does not seem to agree 🙂

      Do I miss somethings there ?

       Thanks.

      Chris

    • #16250

      Apparently, my issue is due to some remote access issue. In my first tests, the secondary server, hosting the host to be enabled and started was a remote machine.
      I tried the server on the server hosting the host, and now, the scripts works. Not perfect, but I'm going somewhere.

      If anyone knows how to make it works from another machine, will make me happy 🙂 (I thought could be DCOM/COM issue, but the remote server does not show any error / logs).

       thanks,

      Chris

    • #25873

      Did you manage to fix this problem?

      • #26522

        Yes, this work, if we want to disable the host instance, no matters if host instance is started or stopped. But it doesn't enable the host instance, if I set Is Disabled property to false. Don't know why:(

        • #26592

          How you are doing it from remote machine?? Please let me know the cmdlet  you are using  or the full command.

Viewing 2 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.