Monday, September 1, 2008

How To Rename a VHD Computer Running on a Domain using SharePoint

The company I work for was preparing to develop some SharePoint applications. They wanted to use our existing Windows XP laptops and install Virtual PC 2007 to run a copy of a VHD drive built with Virtual Server 2005, MOSS 2007 and Visual Studio 2008. This had to be a domain server so that we could collaborate with other developers, pass features across the network and check-in source code using TFS."

A Virtual Server 2005 drive with all the goods was created and made available on our network. After downloading the opc-moss-sb3 VHD drive and then booting it using Virtual PC, I got the following message:"

"A duplicate name exists on the network."

This was because someone else was also logged-in to the domain using the same opc-moss-sb3 VHD drive. Unfortunately, booting multiple copies of the same VHD drive using Virtual PC on a domain network will have computer name conflicts with cumputers of the same name.

To fix this problem I had to rename the VHD computer from moss-sp to moss-burt and to correct several issues with SharePoint.

Changing the computer name and SharePoint applications

Following are the steps I used to successfully rename my copy of the VHD computer.

Note: In case you make a mistake make sure your VHD settings for Undo Disks is Enabled.

Note: For these steps to work you must be logged in to the domain when you boot your XP computer. A RAS connection will not work.

Note: Near the end of this process a Helpdesk support person will be needed to join your VHD computer back into the domain. Make sure that one is available before you start.

1. Choose a name that you want to use for your computer. This name will be used for several steps during the renaming process. For this example I will use the name moss-burt for my new computer.

2. Boot the moss-sp VHD drive and login to your domain. If you have problems logging-in then try disconnecting the network cable. Contact the helpdesk if you have problems. They will need to disconnect the other duplicate server so you can login to the domain.

3. Make sure you have a local administration user account. This will be used to login after you detach from the domain and reboot your system.

4. Change the alternate access mapping for your MOSS deployment in SharePoint Central Administration:

a. Open Central Administration, "Operations" Tab, "Alternate access mappings" link

b. Modify the any mapping items to reflect your newly chosen server name. Make sure you use the same port number. I changed http://moss-sp:48873/ to http://moss-burt:48873/.

Note: For future reference, as an alternative, you can use the Dos command "stsadm.exe addalternatedomain" instead of Central Administration. Open a command prompt window and enter the following:

> CD "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"
> stsadm -o addalternatedomain -url :http://: -urlzone extranet -incomingurl :http://:

5. Use stsadm.exe to invoke the "renameserver" command option. Open a command prompt window and enter the following:

a. cd "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"

b. stsadm -o renameserver -oldservername -newservername
Example: stsadm -o renameserver -oldservername "moss-sp" -newservername "moss-burt"

6. Rename your computer via Change Name Operation:

a. Go to Start Menu Control Panel System, "Computer Name" tab, "Change" button.

b. Input your new server name. Example: moss-burt

c. Set the "Member of" To Workgroup and enter WORKGROUP for the workgroup. This will detach your computer from the domain.

7. Reboot the server and login using your local user account.

8. Go back into the Computer Name and change from the WORKGROUP back to the domain name.

9. At this point an IT support person will need to login with their credentials to join you back into the domain.

10. Reboot the system and login using the user domain account.

11. Open command prompt and enter the following:

> CD C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
> stsadm -o updatefarmcredentials -userlogin -password

Example: stsadm -o updatefarmcredentials -userlogin "domain\username" -password "password"

12. Open command prompt and resart IIS.

> iisreset /noforce

Fix SharePoint Forms Authentication Applications using MemebershipProvider

After the computer rename I discovered a problem with a Forms Authentication web application that uses a custom Membership Provider. It had a problem in the extranet NTLM SharePoint site under People and Groups and was not able to find a user from the named Membership Provider I created. I also discovered the following error in the Application Manager > User Profiles and Properties section:

"An error has occurred while accessing the SQL Server database or the Office SharePoint Server Search service"

I was not able to find a simple fix for this problem but I was able to work around it by recreating the SSPAdmin site and any web applications that require a custom Membership Provider. Following are the steps to do this using the Central Administration web site.

1. Create a new SSPAdmin application from Application Management > Create or Extend Web Application. I called mine SSPAdmin1. This will be used when creating the new SSPAdmin shared service.

2. Create a new MySite application from Application Management > Create or Extend Web Application. I called mine MySite1. Make sure to use the Enterprise / My Site Host for the Select a template. This will be used when creating the new SSPAdmin shared service.

3. Create a new SSP from Shared Services Administration and reassign the existing web applications.

  • Select New SSP to create a new SSPAdmin using the two web applications above. I called mine SSPAdmin1.
  • Move the existing web applications to the new SSP by "Changing Association".
  • Make the new SSPAdmin1 the "Default SSP".
  • Deleted the Shared Services Provider called SSPAdmin including the database.
4. Deleted the MySite web application that was associated with SSPAdmin from Application Management > Delete Web Application.

5. Delete any web applications that require a custom Membership Provider and recreate it.

Now, for the most part, you are done with renaming the computer! You will still need to change the server name in things like Favorite links. Make sure you can run the Central Administration, the new SSPAdmin1 and any SharePoint applications that use a custom Membership Provider. If you had a search index then drop this, and rebuild it. You may also want to check all Application Pool identities in IIS and update any old machine name. I didn’t find any.

There may be things that need fixing down the road that I will update on this blog.

1 comment:

AMU1962 said...


Great stuff mate.....I had toiled with moving a Sharepoint Website to Vmware for days. Your blog highlighted a few things that I was doing worked.

Many thanks,