Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.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
使用Powershell检查远程服务器上的IIS logFile.period_Powershell_Iis_Logging - Fatal编程技术网

使用Powershell检查远程服务器上的IIS logFile.period

使用Powershell检查远程服务器上的IIS logFile.period,powershell,iis,logging,Powershell,Iis,Logging,我需要检查大约100台服务器的IIS日志设置。我正在运行PS 5,我发现这为我提供了本地服务器的设置: Import-Module WebAdministration Get-ChildItem IIS:\Sites Get-ItemProperty 'IIS:\Sites\Default Web Site' -Name logFile.period 要在远程服务器上运行相同的东西,我需要做什么?PSRemoting是您要问的问题 这是一个有很好文档记录(使用GUI和PowerShell)

我需要检查大约100台服务器的IIS日志设置。我正在运行PS 5,我发现这为我提供了本地服务器的设置:

Import-Module WebAdministration

Get-ChildItem IIS:\Sites

Get-ItemProperty 'IIS:\Sites\Default Web Site' -Name logFile.period

要在远程服务器上运行相同的东西,我需要做什么?

PSRemoting是您要问的问题

这是一个有很好文档记录(使用GUI和PowerShell)的东西,文章和示例代码遍布web

在本地和远程计算机上运行命令

invoke-command -ComputerName 'IIS' -ScriptBlock {
    Import-Module WebAdministration
    Get-ChildItem IIS:\Sites
    Get-ItemProperty 'IIS:\Sites\Default Web Site' -Name logFile.period
}
如何远程检索IIS HTTP日志

通过powershell获取IIS日志位置?