Windows Power Shell Rename Computer RRS feed

  • Question

  • I am completely new to Windows Power Shell.  I was running a VBS and since Netdom does not run on Windows 10 and we have moved to Windows 10.  I am looking to use Power Shell to get something like this:

    '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","Windows 2k3 Netdom Rename Script")
    sNewCname = InputBox("Enter computers new name","Windows 2k3 Netdom Rename Script")

    Call WSHShell.Run("cmd.exe /K NETDOM RENAMECOMPUTER " & sOldCname & " /newname:" & sNewCname & " /userd:/passwordd:* /force /reboot ")

    Any help would be greatly appreciated



    • Edited by Golforfood1 Friday, June 29, 2018 3:44 PM
    • Moved by Bill_Stewart Tuesday, July 31, 2018 3:19 PM This is not "debug/fix/rewrite my script for me" forum
    Friday, June 29, 2018 3:43 PM

All replies