none
rename and reboot machine

    Question

  • this is not quite working....

    function renameAndReboot([string]$computer, [string]$newname)
    {
    $comp = gwmi win32_computersystem -computer $computer
    $os   = gwmi win32_operatingsystem -computer $computer
    $comp.Rename($newname)
    $os.Reboot()
    }

    renameAndReboot oldmachine newmachine

    I keep getting a return value of 5 and cannot get the machine renamed

    Wednesday, February 29, 2012 6:34 AM

Answers

All replies