如何使用PowerShell脚本远程启动/停止IIS 6.0/7.0? [英] How To start/stop IIS 6.0/7.0 remotely using PowerShell Scripts?
本文介绍了如何使用PowerShell脚本远程启动/停止IIS 6.0/7.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个服务器A和服务器B.我想使用Powershell脚本从服务器B远程停止服务器A.
I have two servers Server A and Server B. I want to stop server A from Server B remotely using Powershell script.
推荐答案
One of the simplest ways to do this is really with just a command line execution using PsExec. And send over to the machines
IISReset/STOP或/START或/RESTART
IISReset /STOP or /START or /RESTART
所以你会做这样的事情
PsExec \\Server2 -u Administrator -p somePassword IISReset /STOP
如果您使用此路线或涉及某种类型的管理员级别帐户模拟的任何路线,请谨慎使用密码管理,以使没人能获得管理员密码的纯文本副本.
Just be careful with password management if you go this route or any route that involves some type of admin level account impersonation so that no one can get a plain text copy of the admin password.
这篇关于如何使用PowerShell脚本远程启动/停止IIS 6.0/7.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文