VMware Cloud Community
sivagndl
Enthusiast
Enthusiast
Jump to solution

Rename vm's find

Hi All,

We have many vm's are renamed. Those vm's are  renamed but vmdk still old name.

Need to found those vm's .

Thanks,

Siva

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try something like this.

It compares the VM's Displayname with the folder name of the VM's VMX file.

Get-View -ViewType VirtualMachine |

where{$_.Name -ne $_.Config.Files.vmPathName.Split('.')[0].Split('/')[-2]} |

Select Name


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

2 Replies
LucD
Leadership
Leadership
Jump to solution

Try something like this.

It compares the VM's Displayname with the folder name of the VM's VMX file.

Get-View -ViewType VirtualMachine |

where{$_.Name -ne $_.Config.Files.vmPathName.Split('.')[0].Split('/')[-2]} |

Select Name


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

sivagndl
Enthusiast
Enthusiast
Jump to solution

Thanks Lucd.. Grate

It's worked after Array [-1].

Get-View -ViewType VirtualMachine |where{$_.Name -ne $_.Config.Files.vmPathName.Split('.')[0].Split('/')[-1]} |Select Name

0 Kudos