Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $computer_info = systeminfo
- $network_info = ipconfig /all
- $netstat_info = netstat -ano
- $firewall_rules_all_profiles_info = netsh advfirewall firewall show allprofiles
- $firewall_rules_info = netsh advfirewall firewall show rule name=all
- $routing_table_info = Get-WmiObject -class "Win32_IP4RouteTable"
- $os_system_logs_info = Get-EventLog -LogName System -Newest 1000
- $os_application_logs_info = Get-EventLog -LogName Application -Newest 1000
- $os_services_info = Get-WmiObject Win32_Service
- $os_processes_info = Get-Process | Select *
- $logpath = "%TEMP%\MigrationLogs\$env:computername"
- $timestamp = get-date -Format yyyyMMdd-hhmm
- New-Item -ItemType directory -Path "%TEMP%\MigrationLogs\$env:computername"
- $computer_info | Out-File -FilePath "$logpath\computer-info-$timestamp.txt"
- $network_info | Out-File -FilePath "$logpath\network-info-$timestamp.txt"
- $netstat_info | Out-File -FilePath "$logpath\netstat-info-$timestamp.txt"
- $firewall_rules_all_profiles_info | Out-File -FilePath "$logpath\firewall-rules-all-profiles-info-$timestamp.txt"
- $firewall_rules_info | Out-File -FilePath "$logpath\firewall-rules-info-$timestamp.txt"
- $routing_table_info | Export-Csv -NoTypeInformation -UseCulture "$logpath\routing-table-info-$timestamp.csv"
- $os_system_logs_info | Export-Csv -NoTypeInformation -UseCulture "$logpath\os-system-logs-info-$timestamp.csv"
- $os_application_logs_info | Export-Csv -NoTypeInformation -UseCulture "$logpath\os-application-logs-info-$timestamp.csv"
- $os_services_info | Export-Csv -NoTypeInformation -UseCulture "$logpath\os-services-info-$timestamp.csv"
- $os_processes_info | Export-Csv -NoTypeInformation -UseCulture "$logpath\os-processes-info-$timestamp.csv"
- logman start "system\system diagnostics"
- Start-Sleep -s 90
- Copy-Item "C:\PerfLogs\System\Diagnostics\" -Destination "$logpath\Perfmon\" -Recurse
- Copy-Item "C:\Windows\System32\Drivers\etc\hosts" -Destination "$logpath\hostfile.txt"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement