Ghost Solution Suite

 View Only
  • 1.  How to remote start a Ghostcast session with PsExec (or something similar)?

    Posted May 01, 2007 03:50 PM
    I need help with remote executing the following command against my Ghost server with a tool such as PsExec (like from a boot disk for example).
     
    If I type this from the comand prompt on my ghost server, it automatically starts ghostcast in the mode I want, and I can connect
     
    "c:\program files\symantec\ghost\ghostsrv.exe g:\ghostimages\image.gho SESSIONNAME -disk1 -p1 -PART1 -n1"
     
    I can even create an AT job remotely on another box and it works, using this syntax:
     
    at \\ghostserver 3:45pm "c:\program files\symantec\ghost\ghostsrv.exe g:\ghostimages\image.gho SESSIONNAME -disk1 -p1 -PART1 -n1"
     
     
     
    Unfortunatly, you cannot use the AT command from within WinPE 2.0.  This is why I need to use a 3rd party tool such as PsExec.
     
     
    I am trying to execute remotely with PsExec using the following syntax:
     
    psexec \\ghostserver -u domain\userid -p password "c:\program files\symantec\ghost\ghostsrv.exe g:\ghostimages\image.gho SESSIONNAME -disk1 -p1 -PART1 -n1"
     
    Generates an error that the path cannot be found
     
    psexec \\ghostserver -u domain\userid -p password "c:\program files\symantec\ghost\ghostsrv.exe"  "g:\ghostimages\image.gho SESSIONNAME -disk1 -p1 -PART1 -n1"
     
    Launches Ghostsrv.exe on the ghost server, but the server does not accept incoming connections.  Suspect that it not passing the arguments correctly.
     
     
     


  • 2.  RE: How to remote start a Ghostcast session with PsExec (or something similar)?

    Posted May 01, 2007 04:08 PM
    Unfortunately I use WMI to do what you are doing so I'm not much help with your PSExec problem.   If you want to confirm the session is running or not just run "nbtstat -a" on the machine you spawned it on.  If your session name is in the name list, then the server is started, if its not then it is not.
     
    For some reason I am thinking you may want to try the -i  (interactive) switch.  Even though nothing will be visible I think I had a problem trying to spawn an invisible ghostcast server.


  • 3.  RE: How to remote start a Ghostcast session with PsExec (or something similar)?

    Posted May 01, 2007 04:22 PM
    David,
     
    I have nothing against WMI.  If there is a clean method to use WMI to remote launch an executable and pass arguements, I'd love to see an example.


  • 4.  RE: How to remote start a Ghostcast session with PsExec (or something similar)?

    Posted May 01, 2007 04:45 PM

    Let me see if I can break this out, below is the function in .net that I call but the variables are very generic so I recyle this code without it being ghost specific:

    Code:

     Function ProcessCreate(ByVal Server, ByVal cmd)       Dim process, processid, nRet       If Server = "" Then           process = GetObject("WinMgmts:{impersonationLevel=impersonate}!/root/cimv2:Win32_Process")       Else           process = GetObject("WinMgmts:{impersonationLevel=impersonate}!//" & Server & "/root/cimv2:Win32_Process")       End If       nRet = process.Create(cmd, System.DBNull.Value, System.DBNull.Value, processid)       If (nRet <> 0) Then               MsgBox("Failed To Create Remote GhostCast Session " & Session.Text & " Process on Server " & Server, MsgBoxStyle.Critical, "GhostSrv Create Failed")               End       End If       ProcessCreate = processid       process = Nothing   End Function


     

    Now that I look at the code its not .net specific, you could use this in VB6 or put it in a converter to make it vb script Im sure. Anyway, let me see if I can derive my ghostcast server command line for you:

    When I call the function this is what I do:

    Code:

    ProcessCreate(ServName.Text, ServerPath & "ghostsrv.exe " & ImagePath.Text & " " & Session.Text & " " & Switches.Text)


     

    The first entry is the server I want to remote spawn on, the second is the command line which would look something like this:

    \\server\c$\ghost\ghostsrv.exe \\server\c$\ghost\image.gho ghostsessionname + whatever switches

    Darn Smileys!  The smiley should be close Parenthesis

    Message Edited by David.Poprik on 05-01-200701:52 PM

     

    Oh and FYI this impersonates the user running it, I would have to look up supplying credentials.  This is about 3 years old, I use real .net WMI code these days not vb script code.

    Message Edited by David.Poprik on 05-01-200701:57 PM



  • 5.  RE: How to remote start a Ghostcast session with PsExec (or something similar)?

    Posted Jan 07, 2010 10:17 AM
    Is it possible to start PsExec with WindowsPE to start the GhostCastServer from a client?


  • 6.  RE: How to remote start a Ghostcast session with PsExec (or something similar)?

    Posted Jan 08, 2010 02:37 PM

    PsExec was a command line utility when I used it a few years ago, so I don't forsee any issues with starting it from WinPE, as long as you have a network connection to the server from the client