Score:0

How to exit MDT task sequence from vbscript after validate step in mdt task sequence?

uz flag

I have kept vbscript with just messagebox in mdt after validate section and it got executed.

Similarly I kept another vbscript after that calling an API and able to retrieve the result from it also.

Is there anyway to exit the complete task sequence based on the value of this api result?

If possible to set an exact message there also like we wantedly exited the MDT.

My script.

Option Explicit
MsgBox("from 2 psdsss")
Dim restReq, url, userName, password

Set restReq = CreateObject("Microsoft.XMLHTTP")

' Replace <node> with the address of your INSTEON device
' Additionally, any REST command will work here
url = "http://20.117.158.5:80/machines/1"

' If auth is required, replace the userName and password values
' with the ones you use on your ISY
userName = "admin"
password = "<yourpassword>"

restReq.open "GET", url, false, userName, password
restReq.send

MsgBox(restReq.responseText)
WScript.echo restReq.responseText

My task sequence snap for reference: snap

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.