tshm
10/26/2015 - 6:13 AM

information collection batch script

information collection batch script

$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
$dd = $(get-date -format yyyyMMddhhmss)

mkdir ($scriptPath + '/' + $dd)
pushd ($scriptPath + '/' + $dd)


systeminfo > systeminfo.txt
msinfo32 /report msinfo32.txt

ipconfig /all > ipconfig.txt

schtasks /query /V > schtasks.txt

net use > netuse.txt

netstat -sp > netstat_sp.txt
netstat -e > netstat_e.txt

tasklist > tasklist.txt
tasklist /svc > tasklist_svc.txt
tasklist /m > tasklist_m.txt

wevtutil qe system /f:TEXT > system_log.txt

wevtutil qe Application /f:TEXT > Application_log.txt
pushd c:\log

systeminfo > systeminfo.txt
msinfo32 /report msinfo32.txt

ipconfig /all > ipconfig.txt

schtasks /query /V > schtasks.txt

net use > netuse.txt

netstat -sp > netstat_sp.txt
netstat -e > netstat_e.txt

tasklist > tasklist.txt
tasklist /svc > tasklist_svc.txt
tasklist /m > tasklist_m.txt

wevtutil qe system /f:TEXT > system_log.txt

wevtutil qe Application /f:TEXT > Application_log.txt