Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 172599

vmexe HP files execution with PowerCLI

$
0
0

At the end I'm submitting a new thread as I saw that old thread was not moved to the top after the update.

 

I created a script to upload the file CPxxxx.vmexe successfully to all involved ESXi hosts. Then I'm running this but it produces no result:

 

 

$vmhost = Get-VMHost xxxxxxxxxxxxxxxxxx    
# Login credentials to SSH each host. It will convert the string from secure to plain text for plink  
$user = Read-Host "ESXi Host SSH User"  
$rootpword = Read-Host "ESXi Host SSH Password" -AsSecureString  
$rootbstr = [System.Runtime.InteropServices.marshal]::SecureStringToBSTR($rootpword)  
$rootpword = [System.Runtime.InteropServices.marshal]::PtrToStringAuto($rootbstr)    
# The "echo y" command automatically accepts the key for plink.    echo y | C:\Users\xxxxxx\Documents\VI-Tools\powerCLI\tested\ESXi\plink.exe -ssh $vmhost -l $user -pw $rootpword exit | Out-Null    
#execute patching  
C:\Users\xxxxxx\Documents\VI-Tools\powerCLI\tested\ESXi\plink.exe -ssh $vmhost -l $user -pw $rootpword -batch "chmod +x /tmp/CP035395.vmexe"  
start-process "cmd.exe" "/c echo y | C:\Users\xxxxx\Documents\VI-Tools\powerCLI\tested\ESXi\plink.exe -ssh $vmhost -l $user -pw $rootpword -batch /tmp/CP035395.vmexe"    
sleep -Seconds 60    
$VMhost | Restart-VMHost -Confirm:$false | Out-Null 

 

the host gets rebooted but patch is not applied. Is there a way to successfully execute these kind of files with PowerCLI? Executing those commands from within a ssh session works fine.


Viewing all articles
Browse latest Browse all 172599

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>