A. A reader emailed me about a bug he discovered: When he renamed a server that has dynamic disks, upon reboot he could no longer access the disks via the Disk Management MMC snap-in. Instead of showing the disk content, the snap-in displays the disk icons with a red X and no name.

I tried to reproduce this behavior and was unable to do so. I dug further and discovered that the cause of the problem was the rename: The name of the disk group in the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\dmio\BootInfo\Disk Group registry subkey was the new server name (e.g., newnameDg0 instead of oldnameDg0, which didn't match the configuration that's stored at the end of the dynamic disk. To resolve the problem, I changed the name in the registry to the old server name, which allowed the Disk Management applet to function.

I learned that to rename the server, the user had used a script that searched and replaced server names in the registry rather than using the OS computer rename functionality, which is why the dynamic disk information on the disk wasn't replaced.

The morale is therefore to not rename servers using registry search and replace. Instead, use the OS rename facilities. For example, you can use the netdom command or the Windows Management Instrumentation (WMI) Rename function of the computer object, as the following code illustrates:

    <p>
strComputer = "."  Set objWMIService = GetObject("winmgmts:" _      & "\{impersonationLevel=impersonate\}!\\" _      & strComputer & "\root\cimv2")  Set colComputers = objWMIService.ExecQuery _      ("Select * from Win32_ComputerSystem")  For Each objComputer in colComputers      errReturn = ObjComputer.Rename("NewName")      WScript.Echo "Computer name is now " & objComputer.Name  Next  </p>