Search code examples
powershellpowershell-2.0powershell-3.0powershell-4.0powershell-remoting

Is there a powershell command that would power on another host?


I have a group of computers that I want to power off and then power back on, is there a Powershell command that will do this? I have the 'shutdown' command to turn them off, I can't use the reboot command.

Thanks in advance!


Solution

  • If you use powershell 5.0 + , you can use the Restart-Computer cmdlet.

    $computers = @('name1','name2')
    
    foreach ($computer in $computers)
    {
        Restart-Computer -ComputerName $computer -Force
    }
    
    

    Another alternative is using the shutdown with CMD.

    shutdown -i
    

    Will pop up a nice GUI to do your requirements. enter image description here