Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Events PowerShell:如何在远程服务器上运行脚本?_Events_Powershell_Powershell 2.0 - Fatal编程技术网

Events PowerShell:如何在远程服务器上运行脚本?

Events PowerShell:如何在远程服务器上运行脚本?,events,powershell,powershell-2.0,Events,Powershell,Powershell 2.0,我有一个剧本: $StartDay = (Get-Date).AddDays(-2) Get-EventLog -LogName application -EntryType Error, Warning -After $StartDay 我想从我的计算机(Win XP,PowerShell 1.0)在Server1和Server2(Win 2008,PowerShell 2.0)上运行它。如何在这些服务器上运行此命令?您必须在远程计算机上具有管理凭据 $StartDay = (Get-Dat

我有一个剧本:

$StartDay = (Get-Date).AddDays(-2)
Get-EventLog -LogName application -EntryType Error, Warning -After $StartDay

我想从我的计算机(Win XP,PowerShell 1.0)在Server1和Server2(Win 2008,PowerShell 2.0)上运行它。如何在这些服务器上运行此命令?

您必须在远程计算机上具有管理凭据

$StartDay = (Get-Date).AddDays(-2)
Get-EventLog -LogName application -EntryType Error, Warning -After $StartDay -computername REMOTESERVERNAME

为了使用PowerShell远程处理,您需要在服务器和客户端上安装PowerShell 2.0

查看这些链接。它们是PowerShell远程处理的良好开端: