VMware Cloud Community
nirvy
Commander
Commander
Jump to solution

Need to change the vCenter name through code

Hi all,

I can't figure this out, hopefully it's a real simple thing to do. I need to change the name of the vCenter, like what is in the screeny below, but through powershell code

8596_8596.JPG

can anybody show me how that is done?

Cheers!

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Depending if you have vCenter, Update Manager and License server all running on the same host this not a simple operation.

See for example KB1006843.

To emulate the Rename as can be done from the vSphere Client is straightforward.

You need to be connected to the vCenter.

$optMgr = Get-View (Get-View ServiceInstance).Content.Setting
$optVal = New-Object VMware.Vim.OptionValue
$optVal.Key = "VirtualCenter.InstanceName"
$optVal.Value = <new-vCenter-name>
$optMgr.UpdateOptions($optVal)

____________

Blog: LucD notes

Twitter: lucd22


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Depending if you have vCenter, Update Manager and License server all running on the same host this not a simple operation.

See for example KB1006843.

To emulate the Rename as can be done from the vSphere Client is straightforward.

You need to be connected to the vCenter.

$optMgr = Get-View (Get-View ServiceInstance).Content.Setting
$optVal = New-Object VMware.Vim.OptionValue
$optVal.Key = "VirtualCenter.InstanceName"
$optVal.Value = <new-vCenter-name>
$optMgr.UpdateOptions($optVal)

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
nirvy
Commander
Commander
Jump to solution

Thanks Luc, worked perfectly!

0 Kudos