Create a Java Script to RUN on a Remote Computer.
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
Post a Comment