通过powershell操作eventlog
relevant command list
~\Desktop> (Get-Command Write-EventLog).Parameters Key Value
--- -----
WarningAction System.Management.Automation.ParameterMetadata
RawData System.Management.Automation.ParameterMetadata
Verbose System.Management.Automation.ParameterMetadata
WarningVariable System.Management.Automation.ParameterMetadata
ErrorAction System.Management.Automation.ParameterMetadata
Category System.Management.Automation.ParameterMetadata
InformationAction System.Management.Automation.ParameterMetadata
ErrorVariable System.Management.Automation.ParameterMetadata
Source System.Management.Automation.ParameterMetadata
PipelineVariable System.Management.Automation.ParameterMetadata
EventId System.Management.Automation.ParameterMetadata
OutVariable System.Management.Automation.ParameterMetadata
Debug System.Management.Automation.ParameterMetadata
InformationVariable System.Management.Automation.ParameterMetadata
ComputerName System.Management.Automation.ParameterMetadata
EntryType System.Management.Automation.ParameterMetadata
Message System.Management.Automation.ParameterMetadata
LogName System.Management.Automation.ParameterMetadata
OutBuffer System.Management.Automation.ParameterMetadata
AsJob System.Management.Automation.ParameterMetadata
Write-EventLog
Write-EventLog -Source "SupperSocketService" -LogName "TestLog" -Message "test on 20180928" -EventId 3001
New-EventLog
This command was used to create a new source
New-EventLog -Source "SupperSocketService" -LogName "TestLog" -MessageResourceFile "C:\Test\TestApp.dll"
Remove-EventLog
Remove-EventLog -LogName "TestLog"
Get-EventLog
Get-EventLog -List
Max(K) Retain OverflowAction Entries Log
------ ------ -------------- ------- ---
51,200 0 OverwriteAsNeeded 4,852 Application
512 7 OverwriteOlder 0 Dell
20,480 0 OverwriteAsNeeded 0 HardwareEvents
512 7 OverwriteOlder 0 Internet Explorer
512 7 OverwriteOlder 722 isaAgentLog
10,240 0 OverwriteAsNeeded 21,192 Kaspersky Event Log
20,480 0 OverwriteAsNeeded 0 Key Management Service
512 7 OverwriteOlder 8 Lisa
128 0 OverwriteAsNeeded 179 OAlerts
512 7 OverwriteOlder 0 PreEmptive
8,192 0 OverwriteAsNeeded 2,692 Red Gate Software
51,200 0 OverwriteAsNeeded 24,441 Security
512 7 OverwriteOlder 1 SupperSocketService
51,200 0 OverwriteAsNeeded 20,441 System
20,480 7 OverwriteOlder 1,460 VisualSVNServer
20,480 7 OverwriteOlder 0 VisualSVNServerActivity
20,480 7 OverwriteOlder 490 VisualSVNServerBackgroundJobs
20,480 -1 DoNotOverwrite 0 VisualSVNServerManagement
20,480 7 OverwriteOlder 0 VisualSVNServerReplication
512 7 OverwriteOlder 0 Windows Azure
15,360 0 OverwriteAsNeeded 12,678 Windows PowerShell
通过powershell操作eventlog的更多相关文章
- .NET通过PowerShell操作ExChange为用户开通邮箱账号
最近工作中一个web项目需要集成exchange邮箱服务,注册用户时需要动态创建邮箱用户,终于在http://www.cnblogs.com/gongguo/archive/2012/03/12/23 ...
- .NET通过PowerShell操作ExChange为用户开通邮箱教程
转:http://www.cnblogs.com/gongguo/archive/2012/03/12/2392049.html =================================== ...
- Powershell操作MySQL
最近再用Python写一些监控脚本,并将监控数据输出到MySQL中,最后通过Python抓取MySQL中的数据进行监控汇总告警 考虑到一些微软产品使用Powershell更为方便,于是找了些资料,尝试 ...
- PowerShell 操作 Azure SQL Active Geo-Replication 实战
<Azure SQL Database Active Geo-Replication简介>一文中,我们比较全面的介绍了 Azure SQL Database Active Geo-Repl ...
- PowerShell 操作 Azure Blob Storage
本文假设已经存在了一个 Azure Storage Account,需要进行文件的上传,下载,复制,删除等操作.为了方便查看 PowerShell 代码执行的结果,本文使用了 MS 发布的一个 Azu ...
- PowerShell 操作 Azure SQL Active Geo-Replication
前文中我们比较全面的介绍了 Azure SQL Database Active Geo-Replication 的主要特点和优势.接下来我们将从自动化的角度介绍如何通过 PowerShell 在项目中 ...
- .NET 操作 EventLog(Windows事件日志监控)(转载)
操作Windows日志:EventLog 如果要在.NET Core控制台项目中使用EventLog(Windows事件日志监控),首先需要下载Nuget包: System.Diagnostics.E ...
- powershell 操作sharepoint命令集
打开SharePoint 2013 Management Shell, and then run as administrator.执行如下命令 1. 添加wsp和安装Add-SPSolution - ...
- PowerShell 操作 OFFICE
UiPath操作Office软件的方式,这里说一下用PowerShell调用Office的COM组件的方式 老生常谈~每个程序员都要至少掌握一门脚本编程语言... EXCEL: $excel = Ne ...
随机推荐
- UIApplicationDelegate详解
每 个iPhone应用程序都有一个UIApplication,UIApplication是iPhone应用程序的开始并且负责初始化并显示 UIWindow,并负责加载应用程序的第一个UIView到U ...
- cannot find package "golang.org/x/crypto/pbkdf2" in any of:
cannot find package "golang.org/x/crypto/pbkdf2" in any of: /Users/zhou/go/src/mos.market/ ...
- UTF-8 编码的文件在处理时要注意 BOM 文件头问题
最近在给项目团队开发一个基于 Java 的通用的 XML 分析器时,设计了一个方法,能够读取现成的 XML 文件进行分析处理,当然 XML 都是采用 UTF-8 进行编码的.但是在用 UltraEdi ...
- AC日记——草地排水 codevs 1993
1993 草地排水 USACO 时间限制: 2 s 空间限制: 256000 KB 题目等级 : 钻石 Diamond 题解 题目描述 Description 在农夫约翰的农场上,每 ...
- 设计模式之建造者(Builder)模式
设计模式之建造者(Builder)模式 存在一些情况,比如,一些对象会有一些重要的属性,在这些属性没有恰当的值之前,对象不能作为一个完整的产品使用(如一个电子邮件最起码得有收件人地址):还有一些些情况 ...
- [转]通俗易懂的php多线程解决方案
原文: https://www.w3cschool.cn/php/php-thread.html --------------------------------------------------- ...
- HDU 4902 Nice boat 线段树+离线
据说暴力也过了.还傻逼地写了这么长. . . #include <stdio.h> #include <string.h> #include <math.h> #i ...
- linux下查看网卡信息的命令
rhel 内核版本号信息: [root@hvrhub ~]# uname -a Linux hvrhub 2.6.18-308.el5 #1 SMP Fri Jan 27 17:17:51 EST 2 ...
- Python——正則表達式(2)
本文译自官方文档:Regular Expression HOWTO 參考文章:Python--正則表達式(1) 全文下载 :Python正則表達式基础 ======================== ...
- Vue 基础
1. data 数据 methods 方法 watch 监听变化 2. 模版指令(类似 angular) {{}} v-text 渲染数据 v-html html 结构 3. v-if v-show ...