将服务器上的某些特定日志统一保存至XPS文件
<APACHost.CSV>
Hostname,IP,OSType
srv1,10.103.22.22,Win2003
srv2,10.103.22.37,Win2008
Import-Csv -Path F:\chgpwd\APACHost.CSV | ForEach-Object { "**************" + $_.Hostname + "**************" if($_.OSType -eq 'Win2003') { Get-EventLog -ComputerName $_.hostname -LogName Security -InstanceId 538 -Newest 1 | fl * } else { Get-EventLog -ComputerName $_.hostname -LogName Security -InstanceId 5447 -Newest 1 | fl * } } | Out-Printer -Name "Microsoft XPS Document Writer"