{"id":610,"date":"2013-08-14T21:58:21","date_gmt":"2013-08-14T19:58:21","guid":{"rendered":"https:\/\/www.hostking.host\/blog\/?p=610"},"modified":"2013-08-14T21:58:21","modified_gmt":"2013-08-14T19:58:21","slug":"export-windows-event-logs-powershell","status":"publish","type":"post","link":"https:\/\/www.hostking.host\/blog\/export-windows-event-logs-powershell\/","title":{"rendered":"Export Windows Event logs with PowerShell"},"content":{"rendered":"<p><a href=\"https:\/\/www.hostking.host\/blog\/wp-content\/uploads\/2013\/08\/powershell.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.hostking.host\/blog\/wp-content\/uploads\/2013\/08\/powershell.png\" alt=\"powershell windows server\" width=\"300\" height=\"300\" class=\"aligncenter size-full wp-image-1234\" title=\"\"><\/a><\/p>\n<p>1. Create a text file<\/p>\n<p>2. Paste the following command in:<\/p>\n<p>Get-Eventlog -LogName application -EntryType Error,Warning | Export-csv application_logs.csv | Get-Eventlog -LogName System -EntryType Error,Warning | Export-Clixml system_logs.csv<\/p>\n<p>3. Save this file as windows_event_logs_dumper.ps1<\/p>\n<p>When this script is ran, it pulls all of the application and system event logs, where the -EntryType is warning or error.<\/p>\n<p>Going a step further, you could write a kscript that runs this script, then do a step to &#8220;Upload a file&#8221; which will upload those logs to the computer inventory for each machine the script is ran on.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Create a text file 2. Paste the following command in: Get-Eventlog -LogName application -EntryType Error,Warning | Export-csv application_logs.csv | Get-Eventlog -LogName System -EntryType Error,Warning | Export-Clixml system_logs.csv 3. Save&hellip;<\/p>\n","protected":false},"author":2,"featured_media":1234,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[30,31,32],"class_list":["post-610","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-website-and-web-hosting","tag-event-viewer","tag-logs","tag-powershell","entry"],"_links":{"self":[{"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/posts\/610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/comments?post=610"}],"version-history":[{"count":0,"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/posts\/610\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/media\/1234"}],"wp:attachment":[{"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/media?parent=610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/categories?post=610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostking.host\/blog\/wp-json\/wp\/v2\/tags?post=610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}