-
Notifications
You must be signed in to change notification settings - Fork 238
/
windows-log-collector-full-v3-EVTX.ps1
101 lines (86 loc) · 1.74 KB
/
windows-log-collector-full-v3-EVTX.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
try{
New-Item -ItemType "directory" -Path "wineventlog"
}
catch
{
echo "can't create a new directory"
}
try{
wevtutil epl Security wineventlog/Security.evtx
}
catch
{
echo "Can't retrieve Security Logs"
}
try
{
wevtutil epl System wineventlog/System.evtx
}
catch
{
echo "Can't retrieve System Logs"
}
try{
wevtutil epl Application wineventlog/Application.evtx
}
catch
{
echo "Can't retrieve Application Logs"
}
try{
wevtutil epl "Windows PowerShell" wineventlog/Windows_PowerShell.evtx
}
catch
{
echo "Can't retrieve Windows PowerShell Logs"
}
try{
wevtutil epl "Microsoft-Windows-TerminalServices-LocalSessionManager/Operational" wineventlog/LocalSessionManager.evtx
}
catch
{
echo "Can't retrieve Microsoft-Windows-TerminalServices-LocalSessionManager/Operational Logs"
}
try{
wevtutil epl "Microsoft-Windows-Windows Defender/Operational" wineventlog/Windows_Defender.evtx
}
catch
{
echo "Can't retrieve Microsoft-Windows-Windows Defender/Operational Logs"
}
try{
wevtutil epl Microsoft-Windows-TaskScheduler/Operational wineventlog/TaskScheduler.evtx
}
catch
{
echo "Can't retrieve Microsoft-Windows-TaskScheduler/Operational Logs"
}
try{
wevtutil epl Microsoft-Windows-WinRM/Operational wineventlog/WinRM.evtx
}
catch
{
echo "Can't retrieve Microsoft-Windows-WinRM/Operational Logs"
}
try{
wevtutil epl Microsoft-Windows-Sysmon/Operational wineventlog/Sysmon.evtx
}
catch
{
echo "Can't retrieve Microsoft-Windows-Sysmon/Operational Logs"
}
try{
wevtutil epl Microsoft-Windows-PowerShell/Operational wineventlog/Powershell_Operational.evtx
}
catch
{
echo "Can't retrieve Microsoft-Windows-PowerShell/Operational Logs"
}
try
{
Compress-Archive -Path wineventlog -DestinationPath ./logs.zip
}
catch
{
echo "couldn't compress the the log folder "
}