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