Powershell – way to rename a VM in System Centre Virtual Machine Manager 2012 R2

hyper-vpowershellscvmm

I have a VM in SCVMM that the VM name no longer reflects the name of the OS. OS had to be renamed, and now the VM in SCVMM name is incorrect, and it's greyed out so I can't rename it. Is there any Powershell cmdlets to rename the VM in SCVMM 2012 R2? Thanks

Best Answer

You can use the following to set the name of a Virtual Machine managed by SCVMM 2012 R2:

Get-SCVirtualMachine -Name "VM03" | Set-SCVirtualMachine -Name "VM04"

Cmdlet reference: https://technet.microsoft.com/en-us/library/jj654500(v=sc.20).aspx