Home  >  Article  >  Database  >  使用PowerShell获得Windows Event Log

使用PowerShell获得Windows Event Log

WBOY
WBOYOriginal
2016-06-07 17:37:47898browse

1.创建存储服务器名称的文件computer.csv2.创建PowerShell脚本,通过读取第一步创建的服务器名称,查询EventLog的信息然后存储到CSV文件。代码如下:3.保存脚本

1.创建存储服务器名称的文件computer.csv

164331430.png

2.创建PowerShell脚本,通过读取第一步创建的服务器名称,查询EventLog的信息然后存储到CSV文件。代码如下:

164333977.png

3.保存脚本为test.ps1然后执行可以看到EventLog已经保存到CSV文件。

164335456.png

可以看到通过简单的几行代码可以收集所有服务器上的EventLog进行分析。

本文出自 “关注SQL Server技术” 博客,,请务必保留此出处

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn