Renaming a Workstation with netDom.exe

This item was filled under [ Workstation ]

Simple script to rename a workstations with out going through the hassle of first removing it from the domain, renaming it, and then adding it back to the domain.

@echo off
echo.
echo ———————————-
echo * Rename System Script *
echo ———————————-
echo.
if “%1″==”/?” goto Help
if “%1″==”" goto Help:Main
IF NOT EXIST %windir%\netdom.exe copy C:\Shared Library\Automation\Rename Workstation\netdom.exe %windir%
netdom renamecomputer %computername% /newname:%1 /userd:domain\Username /passwordd:%2 /usero:domain\Username /passwordo:%2 /reboot:20
goto End

:Help
Echo .
echo CompName.cmd : Renames current computer locally and in the domain.
Echo .
echo CompName [NEWNAME] [DOMAINPASSWORD]
echo “/?” Displays command help.
Echo .

:End
Echo .
Echo Command complete
Echo .

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
Tagged with: [ , , , ]
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Comment