List eventlog sources?
hi!
just started playing around eventlog , powershell , can't figure out how list sources of eventlog. can see if source exists , exist:
[system.diagnostics.eventlog]::sourceexists("sourename") [system.diagnostics.eventlog]::lognamefromsourcename("sourcename",".")
how revert it? want sorces of logname , not logname source?
hope understand mean :)
samus
you logs , associated sources:
get-eventlog -logname * |foreach-object {$logname = $_.log;get-eventlog -logname $logname -erroraction silentlycontinue |select-object @{name= "log name";expression = {$logname}}, source -unique}
karl
when see answers , helpful posts, please click vote helpful, propose answer, and/or mark answer
blog: http://unlockpowershell.wordpress.com/
book: windows powershell 2.0 bible
e-mail: -join ("6b61726c6d69747363686b65406d742e6e6574"-split"(?<=\g.{2})",19|%{[char][int]"0x$_"})
Windows Server > Windows PowerShell
Comments
Post a Comment