Automation

 View Only
  • 1.  Automate opening of consoles

    Posted Aug 23, 2014 10:05 AM

    we have a esxi server with about 100 machines on it.

    every day several tasks need to be done on different machines. All machines are numbered: 001 002 003 ... 098 099 0100

    is it possible to automate the opening of the consoles in the vsphere client? I saw there is is an option to create plugins for the vsphere clients but not sure if this can be accomplished.

    my idea: click on button, dialog opens with listbox.

    in the listbox i copy paste the machines that need attention today, for example:

    006

    019

    053

    068

    072

    099

    (in real world this are about 20 machines, that is why i want to automate it, as it's a awful job to open 20 consoles multiple times daily...)

    i hit button "Do it!"

    and all needed consoles are opened.

    Is this possible?



  • 2.  RE: Automate opening of consoles
    Best Answer

    Posted Aug 23, 2014 01:48 PM

    Hi jhjkempen,

    Maybe you can try something like this in PowerCLI:

    #List de VMs in a window and select the machines that you need

    $vms = Get-VM | Out-GridView -PassThru

    #Open console of the selected virtual machines

    $vms | Open-VMConsoleWindow

    More info: Opening the Virtual Machine Remote Console through PowerCLI | VMware PowerCLI Blog - VMware Blogs



  • 3.  RE: Automate opening of consoles

    Posted Aug 25, 2014 07:50 AM

    thanks Roberto,

    that seems a good solution. But some points:

    -PassThru is not available in my PowerCLI, is that possible?

    i rather select the VMs using this way:

    Get-VM -Name 420*   (this wil select vmware with 420 in name); but is it possible to select multiple VMware using this method. Something like: Get-VM -Name 056*, 068*, 099*.

    So sending an array of strings that should be matched?

    Also noticed the Chrome / Internet Explorer plugins are not stable when opening multiple consoles in 1 request. Only the last opened console gets a real desktop view. Other opened consoles just give a blank / white screen... (tested on Windows 7 64 bit and Windows 7 32bit machine)

    On firefox it's possible to open 10+ consoles without any problem!



  • 4.  RE: Automate opening of consoles

    Posted Aug 25, 2014 07:56 AM

    found a solution:

    $vms = Get-VM -Name (Get-Content c:\machinelist.txt)

    and machinelist.txt contains this:

    169*

    183*

    237*

    244*

    253*

    176*

    207*

    210*

    228*

    256*

    248*

    162*

    195*

    245*

    266*

    277*

    works perfect!



  • 5.  RE: Automate opening of consoles

    Posted Aug 25, 2014 05:04 PM

    Thanks for share the tests with IE and Chrome.

    I think that the -Passthru parameter in the Out-GridView cmdlet is available only in PowerShell v3 and v4, so maybe you have version 2.



  • 6.  RE: Automate opening of consoles

    Posted Nov 13, 2014 09:06 AM

    i use this command to to put a list of vmwares in memory:

    $vms = Get-VM -Name (Get-Content c:\machinelist.txt)

    the machinelist.txt contains this:

    001*

    002*

    005*

    all my numbered using this way:

    001 machine windows xp

    002 machine test visual studio

    005 windows 10 beta

    the * wildcard assures that the correct vmware is found.

    Is it possible to leave out the "*" in the text file, and automatically let the * be added when reading the text file out?

    Reason: internally in Excel we only use the number part of the vmware names and when i copy and paste this from excel in the textfile i get:

    001

    002

    005

    and we need to manually add the * after each number. (and this needs to be done lot's of time during day, and most of time with 10+ vmwares)

    Hope someone has a suggestion!



  • 7.  RE: Automate opening of consoles

    Posted Nov 17, 2014 02:45 PM

    nobody has a clue on this?