Powershel Script Problem
hy all,
i have problem script :
$server = read-host "server"$package = read-host "id"
$scriptpath = "\\" + $server + "\source\" + $package + "\install.vbs"
$script = cscript $scriptpath
psexec.exe -u domain\admin -p password $poste $script
when executed script has launch .vbs script install program on distant pc script installs program on pc
i have tried combine psexec -u domain\admin -p password \\pc-name cmd.exe , type command line cscript \\server \source\id-package\install.vbs in script powershell me in daily work. install lot of programs on lot of pc.
note : have tried even psexec -u domain\admin -p password \\pc-name cmd.exe /k $script had same problem
can me please?
hi, try use invoke-command powershell cmdlet instead psexec. or don`t have windows management framework on remote server?
$server = read-host "server" $package = read-host "id" $scriptpath = "\\$server\source\$package\install.vbs" $credentials = get-credentials invoke-command -computername $server -argumentlist $scriptpath -scriptblock {param($scriptpath);cscript $scriptpath} -credentials $credentials
Windows Server > Windows PowerShell
Comments
Post a Comment