Subscribe to Windows IT Pro
February 21, 2007 12:00 AM

I've renamed servers using a special script but am now having problems accessing disks via the Microsoft Management Console (MMC) Disk Management snap-in. What's the problem?

Windows IT Pro
InstantDoc ID #95252
Rating: (0)

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:

    

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

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.