Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 232869

Re: Looping vm machines and doing file operations

$
0
0

You can do something along these lines (prototyping in PowerCLI)

 

 

$si=Get-ViewServiceInstance
$vmOpMgr
=Get-View$si.Content.guestOperationsManager
$vmProcMgr
=Get-View$vmOpMgr.fileManager
$spec
=New-ObjectVMware.Vim.GuestProgramSpec
$spec
.programPath="C:\myprogram.exe"
$spec.workingDirectory="C:\Temp"
$auth
=New-ObjectVMware.Vim.NamePasswordAuthentication
$auth
.interActiveSession=$false
$auth
.username="domain\account"
$auth
.password="mysecretpassword"
Get-View
-ViewTypeVirtualMachine|%$vmProcMgr.StartProgramInGuest($_.MoRef,$auth,$spec) }

 

It will execute the program C:\myprogram.exe on all the VM and use the credentials passed through the $auth variable.


Viewing all articles
Browse latest Browse all 232869

Trending Articles



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