【发布时间】:2016-04-21 07:54:28
【问题描述】:
我在 Windows Server A 和 Server B 中有两台服务器。它们都是 Task scheduler 中定义的任务。是否有工具或程序允许仅在以下情况下在一台服务器上自动执行任务:
- 其中一个服务器不可用。
- 其中一台服务器比另一台更早启动。
请帮忙。
【问题讨论】:
标签: windows scheduled-tasks scheduling
我在 Windows Server A 和 Server B 中有两台服务器。它们都是 Task scheduler 中定义的任务。是否有工具或程序允许仅在以下情况下在一台服务器上自动执行任务:
请帮忙。
【问题讨论】:
标签: windows scheduled-tasks scheduling
我不知道。您需要编写一个脚本来控制它。 IE 服务器 1 检查服务器 2。如果它启动,它会检查它的正常运行时间。如果它的正常运行时间大于服务器 1,它什么也不做。服务器 2 也是如此。
您可能会遇到同时处理和处理网络信号的情况。您可以通过 wmi Find last boot up time of remote Windows computers using WMI 来查看远程启动时间
PS C:\>$LastBootUpTime = Get-WmiObject Win32_OperatingSystem -Comp winxpssd |选择 -Exp LastBootUpTime PS C:\> [System.Management.ManagementDateTimeConverter]::ToDateTime($LastBootUpTime)Powershell 3 具有 Get-CimInstance,您可以在其中使用 -ComputerName Powertip get the las boot tim with powershell.aspx
Get-CimInstance 文档可以在here找到
Get-CimInstance -ClassName win32_operatingsystem |选择 csname, lastbootuptime【讨论】: