Pages: [1]
Print
Author Topic: vm's names not listed correctly  (Read 356 times)
untame274
Newbie
*
Posts: 1


View Profile Email
« on: July 27, 2009, 03:38:44 PM »

 Huh
1. I use the get-vm * | sort-object  -name -descending and I get a list of all the vms.. fine.
2. When I run a get-vm by the name of the vm it does not display it..
3. The names are like (0xpclient2344-tl, 3rheacsd-exbe-1b..) and when I try to grab these vms to do a tool update it does not pick the name of the vm but I can see them clearly...
4. Is it to do with powershell not listing the full length of the vm's names???
5. I am trying to get i. the service pack ii. the kb updates... iii.. script to an array of vms to run the vm tools update for about 287vms and put in place a -noreboot option once the tools are installed and write a report back with export-csv, filter the columns only with hostname,vmname, OS, service pack, kb, powered-on,powered off, last update to a .csv format..
6. I have a san+vm so called geek who seems to think he is the 1 one... but when I ask him for this he gives me report from a update mgr vm which isn't accurate for my projections for disk usage, etc.
Can anyone give me a pointer or let me know what I am missing???
Logged
esarakaitis
Administrator
Full Member
*****
Posts: 241


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #1 on: July 28, 2009, 09:18:50 AM »

try a get-cluster "clustername" | get-vm "name" and see if that works any better, here is what i do to get list of names

Code:
$VMs = Get-VM
foreach ($VM in $VMs){
$VM = Get-View $VM.ID
$nm = $VM.name
    $hn = $VM.guest.hostname
    $vm | select @{Name = "Name"; Expression = {$nm}}, @{Name = "Hostname"; Expression = {$hn}}
    }
Logged
Pages: [1]
Print
Jump to: