change hostname of standalone servers remotely

Muhammad Imran 1 Reputation point
2020-07-29T13:52:43.497+00:00

Hi,

In my Windows Network, I have a computer acting as lightweight standalone server. It has a small lightweight App running under Windows 7 x64. App is licensed and has specific requirements so Operating System etc. can't be upgraded. I need to change the hardware for this server. App vendor is ready to re-license same App on new server as long as new server has same App verion and similar software platform and exact same hostname from existing in-use server.

I have setup and configured a new machine with all above requirements except that I did not use same hostname because both servers are online at the moment. App on new server is running as demo version till it gets licensed. To get license I need to rename new server's hostname as is on existing server. Then provide vendor the keys generated by App on new servrer.

Following is config example of my servers

Existing Server

Hardware: Dell
Software: all software platform set as required by my App
Hostname: PA (example)
Domain: kd.com (example)
My App: Licensed
Server is domain joined but is a stand alone server.

New Server

Hardware: HP
Software: all software platform set as required by my App
Hostname: PA2 (example)
Workgroup: WORKGROUP (example)
My App: Demo expired. waiting to be licensed
Server is stand alone. Will join domain later.

Obviously to get App licensed on new server, it must get old server's hostname. To avoid running two machines with same hostname, old server's hostname must also be changed. I have decided to swap hostnames on both servers.

Here are my questions:
Q.1 I am using Teamviewer and have local admin access to both servers. How can I change hostname on both servers remotely?
Q.2 is it safe to rename my existing server(domain joined) directly from the server itself remotely or doing so will hurt its registeration in domain?

waiting for reply

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
5,959 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Dave Patrick 426.2K Reputation points MVP
    2020-07-29T13:58:59.187+00:00

    You can follow along here to rename this workstation using PowerShell.
    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/rename-computer?view=powershell-7

    --please don't forget to Accept as answer if the reply is helpful--


  2. Vicky Wang 2,646 Reputation points
    2020-08-03T09:21:29.8+00:00

    Hi,
     
    Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance.
     
    Best Regards,
    Vicky

    0 comments No comments

  3. Vicky Wang 2,646 Reputation points
    2020-08-06T07:57:07.123+00:00

    Rename a computer that hosts a stand-alone instance of SQL Server
    For a renamed computer that hosts a default instance of SQL Server, run the following procedures:

    SQL

    Copy
    sp_dropserver <old_name>;
    GO
    sp_addserver <new_name>, local;
    GO
    Restart the instance of SQL Server.

    For a renamed computer that hosts a named instance of SQL Server, run the following procedures:

    SQL

    Copy
    sp_dropserver <old_name\instancename>;
    GO
    sp_addserver <new_name\instancename>, local;
    GO
    Restart the instance of SQL Server.

    After the Renaming Operation
    After a computer has been renamed, any connections that used the old computer name must connect by using the new name.

    Verify renaming operation
    Select information from either @@SERVERNAME or sys.servers. The @@SERVERNAME function will return the new name, and the sys.servers table will show the new name. The following example shows the use of @@SERVERNAME.

    Copy
    SELECT @@SERVERNAME AS 'Server Name';

    0 comments No comments