当前位置:主页 > 专题 > 韩博士文章资讯 >

技术编辑恢复win10系统利用powershell让局域网电脑集体重启的问题?

发布日期:2019-11-13      作者:韩博士系统官网      来源:http://www.hanboshi123.com

技术编辑恢复win10系统利用powershell让局域网电脑集体重启的问题?

  powershell是一种命令行外壳程序和脚本环境,使命令行网友和脚本编写者可以利用 .nET Framework的强大功能,那么在win10系统中,咱们也可以利用powershell让局域网电脑集体重启,该怎样操作呢,下面小编就给我们分享一下win10系统利用powershell让局域网电脑集体重启的技巧吧。

  1、单机重启

  这个功能比较简单,命令也容易,只不过重启还得用命令就显得有点麻烦。命令格式如下:

01Restart-Computer 复制代码 Restart-Computer

  提示:这个命令执行后,系统会立刻重启,所以如果电脑没准备好,小心手滑。

  2、集体重启

  如果是让两台以上电脑重启,采用这个方式就比较方便,总比挨个去点重启要方便得多,适用于局域网管理员,命令格式如下:

01Restart-Computer -Computername "server01", "server02", "localhost" 复制代码 Restart-Computer -Computername "server01", "server02", "localhost"

  提示:引号中的内容为具体电脑在局域网中的名称,而“localhost”为本机。

  3、远程重启

  对于远程计算机,可以设置重启延迟时间,命令示例如下:

01Restart-Computer -Computername "server01" -wait -For powershell -Timeout 600 -delay 5 复制代码 Restart-Computer -Computername "server01" -wait -For powershell -Timeout 600 -delay 5

  提示:其中的“600”是秒数,600秒就是10分钟。该命令就是让远程计算机最多等待powershell启动完毕十分钟;延迟为5秒,意为每5秒查询一次powershell启动情况。如果在十分钟内powershell启动,则在发现成功启动后立即重启;如果十分钟到时后仍未启动powershell,则远程电脑将重启。

  关于win10系统利用powershell让局域网电脑集体重启的技巧就给我们详解到这边了,有需要的网友们可以采取上面的办法步骤来进行操作吧。