Get VMWare Tools of all VMs: Unterschied zwischen den Versionen

Aus QBWiki
Zur Navigation springenZur Suche springen
(Die Seite wurde neu angelegt: „<syntaxhighlight lang="bash" line="1"> for i in $(vim-cmd vmsvc/getallvms | awk '{print $1}' | grep -oE '[0-9]{2,4}'); do echo "$i : " ; vim-cmd vmsvc/get.g…“)
 
 
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt)
Zeile 1: Zeile 1:
 +
Log into a vsphere host and issue the following command, either separated with ';' or saved as script
 +
 
<syntaxhighlight lang="bash" line="1">
 
<syntaxhighlight lang="bash" line="1">
for i in $(vim-cmd vmsvc/getallvms | awk '{print $1}' | grep -oE '[0-9]{2,4}'); do  
+
#!/bin/bash
 +
for i in $(vim-cmd vmsvc/getallvms | grep -E 'vmx-[0-9]{2}'| grep -oE '^[0-9]{1,4}'); do  
 
   echo "$i : " ; vim-cmd vmsvc/get.guest $i | grep 'toolsVersion = '
 
   echo "$i : " ; vim-cmd vmsvc/get.guest $i | grep 'toolsVersion = '
 
done
 
done
 
</syntaxhighlight>
 
</syntaxhighlight>

Aktuelle Version vom 17. November 2020, 16:51 Uhr

Log into a vsphere host and issue the following command, either separated with ';' or saved as script

1 #!/bin/bash
2 for i in $(vim-cmd vmsvc/getallvms | grep -E 'vmx-[0-9]{2}'| grep -oE '^[0-9]{1,4}'); do 
3   echo "$i : " ; vim-cmd vmsvc/get.guest $i | grep 'toolsVersion = '
4 done