Renaming the Computer

One of the things that may be required after installing Windows Server 2008 or Windows Vista is to rename the computer. It is true that if you perform an automated install, you may include the name of the computer in the answer file. However, it is also true that from time to time computers need to be renamed. To do this, use the RenameComputer.ps1 script.

Begin the RenameComputer.ps1 script with the param statement. You'll write it a little differently this time, because you want to specify a couple of default values. Set the -computer parameter to the local host computer, and the -user parameter to administrator. The -password parameter is not set, and neither is the -newname parameter, which is used to supply a new name ...

Get Windows PowerShell™ Scripting Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.