Remote VB Script Execution Issues

Home Forums Scripting PowerShell Remote VB Script Execution Issues

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    CaTBuS
    Member
    #167671

    [SIZE=12px]The short: I’m trying to remotely execute a VBScript that resides on a workstation.
    The long: I scripted a complicated application install/config that could not be deployed via SCCM for several reasons, primarily; the install is annoyingly profile specific. I have a base multithreaded PowerShell script that I use for things like this but am having trouble getting the vbscript to execute properly on the remote machines. The script is kicking off but not as me (local admin on all systems) and not elevated.

    Here is the scriptblock I’m using. I could use help either cleaning it up or pointing me in another direction. Also, not sure if cscript.exe or wscript.exe is proper for calling the script. Also, I do plan on rewriting the install script in PowerShell but I hate not being able to figure this out. Thanks in advance for your help Petri Community!!!!

    Code:
    [COLOR=#a82d00][COLOR=#a82d00][COLOR=#a82d00]$session[/COLOR][/COLOR][/COLOR] [COLOR=#696969][COLOR=#696969][COLOR=#696969]=[/COLOR][/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff][COLOR=#0000ff]New-PSSession[/COLOR][/COLOR][/COLOR] [COLOR=#000080][COLOR=#000080][COLOR=#000080]-ComputerName[/COLOR][/COLOR][/COLOR] [COLOR=#a82d00][COLOR=#a82d00][COLOR=#a82d00]$c[/COLOR][/COLOR][/COLOR]
    [COLOR=#a82d00][COLOR=#a82d00][COLOR=#a82d00]$localPath[/COLOR][/COLOR][/COLOR] [COLOR=#696969][COLOR=#696969][COLOR=#696969]=[/COLOR][/COLOR][/COLOR] [COLOR=#8b0000][COLOR=#8b0000][COLOR=#8b0000]”C:TEMPinstall.vbs[/COLOR][/COLOR][/COLOR][COLOR=#8b0000][COLOR=#8b0000][COLOR=#8b0000]”[/COLOR][/COLOR][/COLOR]
    [COLOR=#0000ff][COLOR=#0000ff][COLOR=#0000ff]Invoke-Command[/COLOR][/COLOR][/COLOR] [COLOR=#000080][COLOR=#000080][COLOR=#000080]-Session[/COLOR][/COLOR][/COLOR] [COLOR=#a82d00][COLOR=#a82d00][COLOR=#a82d00]$session[/COLOR][/COLOR][/COLOR] [COLOR=#000080][COLOR=#000080][COLOR=#000080]-ScriptBlock[/COLOR][/COLOR][/COLOR] {[COLOR=#0000ff][COLOR=#0000ff][COLOR=#0000ff]Start-Process[/COLOR][/COLOR][/COLOR] [COLOR=#000080][COLOR=#000080][COLOR=#000080]-Wait[/COLOR][/COLOR][/COLOR] [COLOR=#000080][COLOR=#000080][COLOR=#000080]-FilePath[/COLOR][/COLOR][/COLOR] [COLOR=#8b0000][COLOR=#8b0000][COLOR=#8b0000]”wscript.exe”[/COLOR][/COLOR][/COLOR] [COLOR=#000080][COLOR=#000080][COLOR=#000080]-ArgumentList[/COLOR][/COLOR][/COLOR] [COLOR=#8b0000][COLOR=#8b0000][COLOR=#8b0000]”””[/COLOR][/COLOR][/COLOR][COLOR=#a82d00][COLOR=#a82d00][COLOR=#a82d00]$using:localPath[/COLOR][/COLOR][/COLOR][COLOR=#8b0000][COLOR=#8b0000][COLOR=#8b0000]”””[/COLOR][/COLOR][/COLOR] [COLOR=#000080][COLOR=#000080][COLOR=#000080]-Verb[/COLOR][/COLOR][/COLOR] [COLOR=#8a2be2][COLOR=#8a2be2][COLOR=#8a2be2]RunAs[/COLOR][/COLOR][/COLOR]}

    [/SIZE]

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.