Integrating Integrators – BizTalk, Windows Azure, Windows Workflow, and Beyond

Re: Host Instance / WMI.. can't get it working

BizTalk 2006

This group is for all content related to BizTalk Server 2006. This includes a forum, samples, videos, labs, and tools. Most of the content here also applies to other versions of BizTalk beyond 2006.

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

  • rated by 0 users
  • This post has 4 Replies |
  • 0 Followers
  • 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

    Life's dangerous, no one survives...
  • 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

    Life's dangerous, no one survives...
  • Did you manage to fix this problem?

    Edit
  • 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:(

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

    Edit
Page 1 of 1 (5 items)