« Previous Next »

Thread: msdeploy return -1

Last post 06-10-2009 12:28 PM by super_super_man. 6 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (7 items)

Sort Posts:

  • 06-08-2009, 4:15 AM

    msdeploy return -1

     Hi,

    I am trying to use vbscript to run the msdeploy command and everytime it returns -1.

    Could anyone please tell me what does -1 mean

    Cheers!!!

    RW

  • 06-08-2009, 5:54 AM In reply to

    Re: msdeploy return -1

    I believe MSDeploy should return 0 for success..looks to me like you may have an error running it. Are you able to do some logging to see what fails?

    Check out my blog for other cool tips and tricks:

    http://joelangley.blogspot.com/
  • 06-08-2009, 7:16 AM In reply to

    Re: msdeploy return -1

     That's the other problem. We try to get msdeploy log everything and get emails sent from vbscript. When I get on to the server, I can't find any logs.

    Thanks for your reply.

     RW

  • 06-08-2009, 12:52 PM In reply to

    Re: msdeploy return -1

    Can you try to put this at the end of your msdeploy script:

    -whatif > sim.log

    This should run a simulation (-whatif) and  should create a sim.log file on your server

    Check out my blog for other cool tips and tricks:

    http://joelangley.blogspot.com/
  • 06-10-2009, 5:10 AM In reply to

    Re: msdeploy return -1

    Hi, the interesting bit is if I run it from the command line, everything seems all right. The -1 exit code only occurs in the vbscript result.

    Regards,

    RW

  • 06-10-2009, 11:01 AM In reply to

    Re: msdeploy return -1

    Can you post the vbscript code?

    Check out my blog for other cool tips and tricks:

    http://joelangley.blogspot.com/
  • 06-10-2009, 12:28 PM In reply to

    Re: msdeploy return -1

    Dim objCmd
    Dim strReturn
    Dim strCommand
    Dim strError

    strCommand = "msdeploy -verb:sync -source:webServer,computerName=xxxx -dest:webServer,computerName=yyyy -replace:objectName=binding,targetAttributeName=bindingInformation,match=xx\.xx\.xx\.xx,replace=xx.xx.xx.xx -whatif -verbose > D:\xxxx\Sync-IIS.log"


    set objShell = CreateObject("Wscript.Shell")
    set objProc  = objShell.Exec(strCommand)
    Do While objProc.Status = 0
       WScript.Sleep 10000
    Loop
    If objProc.ExitCode <> 0 then
        strError = "Error running command: " & strCommand & " (Exit Code: " & objProc.ExitCode & ")" & VbCrLf & VbCrLf & "Check logs in xxxx"
        sendErrormail strError (caling a sending email function)
        WScript.Echo "Sending Error mail"
    ElseIf Err.Number <> 0 Then
        strError = "Error running command: " & strCommand & VbCrLf & VbCrLf & "Error Number: " & Err.Number & ". Error Description: " & Err.Description
        sendErrormail strError (caling a sending email function)
        WScript.Echo "Sending Error mail"
    End if

    Set objCmd = Nothing

    -----------------------------------------------------------------------------

    Thanks for your help

    RW

Page 1 of 1 (7 items)
Microsoft Communities