level 9
yuchanbest
楼主
你好,今日随手想拿powershell来查看主机的log,所以想到下面的命令:
PS C:\Documents and Settings\travxie> Get-EventLog -LogName application -after 9:00
Index Time EntryType Source InstanceID Message ----- ---- --------- ------ ---------- ------- 46689 四月 09 14:57 Information MsiInstaller 1033 The description for Event ID '1033' in Source '... 46688 四月 09 14:57 Information MsiInstaller 11707 The description for Event ID '11707' in Source ... 46687 四月 09 14:57 Information MsiInstaller 1042 The description for Event ID '1042' in Source '... 46686 四月 09 14:57 Information MsiInstaller 1040 The description for Event ID '1040' in Source '... 46685 四月 09 13:51 Information McLogEvent 1073742081 将由访问保护规则 (规则处于仅警告模式) (通用标准... 46684 四月 09 12:21 Information McLogEvent 1073742081 将由访问保护规则 (规则处于仅警告模式) (通用标准... 46683 四月 09 12:16 Information McLogEvent 1073742081 将由访问保护规则 (规则处于仅警告模式) (通用标准... 46682 四月 09 12:13 Information McLogEvent 1073742081 将由访问保护规则 (规则处于仅警告模式) (通用标准... 46681 四月 09 12:11 Information McLogEvent 1073742081 将由访问保护规则 (规则处于仅警告模式) (通用标准... 46680 四月 09 10:43 Information SceCli 1073743528 Security policy in the Group policy objects has... 46679 四月 09 09:16 Information McLogEvent 1073746824 McShield service started....
我希望只拿时间和log类型,所以加了select,但是不知道为什么就是显示不了时间:
PS C:\Documents and Settings\travxie> Get-EventLog -LogName application -after 9:00|select Time,entrytype
Time EntryType---- --------- Information Information Information Information Information Information Information Information Information Information Information
应该怎么改呢?
还有,如果我想获得类型为“error”和“warning”的log,应该怎么写呢?
谢谢!
2013年04月09日 10点04分
1
PS C:\Documents and Settings\travxie> Get-EventLog -LogName application -after 9:00
Index Time EntryType Source InstanceID Message ----- ---- --------- ------ ---------- ------- 46689 四月 09 14:57 Information MsiInstaller 1033 The description for Event ID '1033' in Source '... 46688 四月 09 14:57 Information MsiInstaller 11707 The description for Event ID '11707' in Source ... 46687 四月 09 14:57 Information MsiInstaller 1042 The description for Event ID '1042' in Source '... 46686 四月 09 14:57 Information MsiInstaller 1040 The description for Event ID '1040' in Source '... 46685 四月 09 13:51 Information McLogEvent 1073742081 将由访问保护规则 (规则处于仅警告模式) (通用标准... 46684 四月 09 12:21 Information McLogEvent 1073742081 将由访问保护规则 (规则处于仅警告模式) (通用标准... 46683 四月 09 12:16 Information McLogEvent 1073742081 将由访问保护规则 (规则处于仅警告模式) (通用标准... 46682 四月 09 12:13 Information McLogEvent 1073742081 将由访问保护规则 (规则处于仅警告模式) (通用标准... 46681 四月 09 12:11 Information McLogEvent 1073742081 将由访问保护规则 (规则处于仅警告模式) (通用标准... 46680 四月 09 10:43 Information SceCli 1073743528 Security policy in the Group policy objects has... 46679 四月 09 09:16 Information McLogEvent 1073746824 McShield service started....
我希望只拿时间和log类型,所以加了select,但是不知道为什么就是显示不了时间:
PS C:\Documents and Settings\travxie> Get-EventLog -LogName application -after 9:00|select Time,entrytype
Time EntryType---- --------- Information Information Information Information Information Information Information Information Information Information Information
应该怎么改呢?
还有,如果我想获得类型为“error”和“warning”的log,应该怎么写呢?
谢谢!