Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Install Software Remotlly

$
0
0

HI,

 

Try to install the software remotely and cannot get this working?

=====================================================

$computerlist = Get-Content -Path "C:\Scripts\software\computers.txt"

ForEach ($computer in $computerlist)

{

$filepath = Test-Path -Path "\\$computer\C$\Program Files (x86)\Interactive Intelligence\ICUserApps\InteractionClient.exe"

     If ($filepath -eq $false)

     {

Get-Service remoteregistry -ComputerName $computer | Start-Service

     Copy-Item -Path "\\server\softwareshare\ICUserApps_64bit.msi" -Destination "\\$computer\c$\windows\temp\" -Container -Recurse -Force

     Copy-Item -Path "\\server\softwareshare\ICUserApps_64bit_SU6.msp" -Destination "\\$computer\c$\windows\temp\" -Container -Recurse -Force

     $InstallString = '"C:\windows\temp\ICUserApps_64bit.msi" /update "C:\windows\temp\ICUserApps_64bit_SU6.msp" ICSERVERNAME=cic4.com.au /qn'

     ([WMICLASS]"\\$computer\ROOT\CIMV2:Win32_Process").Create($InstallString)

     "$computer" + "-" + "(Get-Date)" | Out-File -FilePath "\\server\softwareshare\CIC4RemoteInstallfile.txt" -Append

     }

     Else

     {

     "$computer" + "_Already_Had_Software_" + "(Get-Date)" | Out-File -FilePath "\\exbendc02\softwareshare\CIC4RemoteInstallfile.txt" -Append

     }

}

=================================================

following message from my computer

 

PS C:\Scripts\software> C:\Scripts\software\rinstall.ps1

__GENUS : 2

__CLASS : __PARAMETERS

__SUPERCLASS :

__DYNASTY : __PARAMETERS

__RELPATH :

__PROPERTY_COUNT : 2

__DERIVATION : {}

__SERVER :

__NAMESPACE :

__PATH :

ProcessId :

ReturnValue : 8

 

PSComputerName :

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles