通过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 ...
随机推荐
- asp.net 错误 类型"xxxxx"同时存在于"xxx.dll"和"xxxx.dll" 中
http://walttoney.blog.163.com/blog/static/127685797201051112839328/错误 类型“System.Web.UI.ScriptManager ...
- CSGO
CSGO Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Problem D ...
- poj 2115 二元一次不定方程
C Looooops Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14765 Accepted: 3719 Descr ...
- 【BZOJ1412】狼和羊的故事(最小割)
题意:将一个由0,1,2构成的矩阵里的1与2全部分割最少需要选取多少条边 n,m<=100 思路:裸的最小割模型 相邻的格子连容量为1的边(其实可以少连很多遍,1与1,2与2之间的边是没有意义的 ...
- [MFC] CString小用例
在实际项目中需要对数字转成的字符串进行格式处理, 如: 50.500000,需要转化成50.5; 1.00000,需要转化成1, 对于编号而言要求都是4位,不足前面补0. 如1转成0001,222转成 ...
- PXE+Kickstart 自动安装CentOS系统
PXE (preboot execcute environment) 依赖服务 dhcp tftp file server (yum repository) 准备TFTP服务器 如何配置TFTP服务 ...
- hdu2448 / 费用流 / harbin赛区c题
题(自)目(己)错(英)综(语)复(太)杂(差),关系理了半小时+翻译才看明白,看明白之后,直接建图,费用流击杀./简单题. 2A:有的地方,可用互通的要建双向边! #include<cstdi ...
- Eclipse FindBugs的安装
原文:http://blog.sina.com.cn/s/blog_62186b460100l3mx.html 1安装:首先到官方网站下载最新版本FindBugs http://findbugs ...
- How do I get an image from an UIButton? 如何获取uibutton设置的uiimage
UIImage*img =[button imageForState:UIControlStateNormal];
- 打印报表以显示具有给定责任的用户-FNDSCRUR责任用户
select --&p_hint distinct user_name, decode ( greatest (u.sta ...