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.
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 nextend 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 ?
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).
Did you manage to fix this problem?
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:(
How you are doing it from remote machine?? Please let me know the cmdlet you are using or the full command.