PowerShell script exchange
Post Reply
sethtuders
Lurker
Posts: 1
Liked: never
Joined: Jan 07, 2020 6:55 pm
Full Name: Seth Tuders
Contact:

Powershell Script to update server hostname after change.

Post by sethtuders »

Hello,
I am looking for a way to automatically update the server name in veeam if the hostname of the server changes. For example here is how to do it manually: https://www.veeam.com/kb2350 , but I would like to find a way to do this without any effort through powershell.
chris.arceneaux
VeeaMVP
Posts: 668
Liked: 359 times
Joined: Jun 24, 2019 1:39 pm
Full Name: Chris Arceneaux
Location: Georgia, USA
Contact:

Re: Powershell Script to update server hostname after change.

Post by chris.arceneaux »

Welcome to the Veeam forums, Seth!

This information can be found in the Windows Registry at the key below:

HKEY_LOCAL_MACHINE\SOFTWARE\Veeam\Veeam Backup and Replication

Image

Assuming the only thing that changed was the hostname and all other SQL DB information is identical (DB name, instance name, login credentials), you only need to update the below registry key and restart the Veeam Backup Service.

Code: Select all

Set-ItemProperty -Path "HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication" -Name SqlServerName -Value "newhostname"
Restart-Service VeeamBackupSvc
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests