Rename Computer Remotely

‘On Error Resume Next

‘open the file system object
Set oFSO = CreateObject(“Scripting.FileSystemObject”)
set WSHShell = wscript.createObject(“wscript.shell”)

Dim sNewCname ‘Variable to hold Computer Name you enter in the inputbox
Dim sOldCname ‘computers current name

‘First param is message text, second is message title
sOldCname = InputBox(“Enter computers current name”,”Computer Rename Utility”)
sNewCname = InputBox(“Enter computers new name”,”Computer Rename Utility”)

Call WSHShell.Run(“cmd.exe /K netdom renamecomputer ” & sOldCname & ” /newname:” & sNewCname & ” /userd:DOMAIN\USER /passwordd:PASSWORD /usero:DOMAIN\USER /passwordo:PASSWORD /force /reboot:5 “)

email me