Renames a computer and its corresponding Active Directory computer account. Requires Windows XP or Windows 2003 Server, and must be run on the local computer.
strComputer = "."Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set colComputers = objWMIService.ExecQuery _("Select * from Win32_ComputerSystem")For Each objComputer in colComputerserr = ObjComputer.Rename("WebServer")Wscript.Echo errNext
This is a VB Script, this can be used by saving the file in .vbs file