Create a Java Script to RUN on a Remote Computer.


i want create script use run powershell on network pcs. must point computername , the path java application stored can server path. if possible must allow me run script in bulk (meaning running more 2 pcs simultaneously) on networked pcs.
have tried not working. script must run silently without users on network see , want not ask admin credentials runs. don't know how put addmin on script @ once users pc not prompt it.

#variables


$computername

=get-contentc:\psdeploy\list.txt


$sourcefile

="\\server\folder\list\java\jre-8u91-windows-i586.exe"


#this section install software


foreach

($computerin$computername)

{


$destinationfolder

="\\$computer\c:\program files (x86)"


#this section copy $sourcefile $destinationfolder. if folder not exist create it.


if

(!(test-path-path$destinationfolder))

{


new-item

$destinationfolder-typedirectory


}


copy-item

-path$sourcefile-destination$destinationfolder


invoke-command

-computername$computer-scriptblock{start-process'c:\temp\jre-7u25-windows-x64.exe'}

first, 'not working' mean?

second, you'll need read documentation oracle provides how silently install java. running installer won't it.




Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

RDS 2012 r2 collections show black screen and then close