IT 专业人员可能必须从一台或多台计算机提取日志文件,以诊断问题。这最好通过远程管理工具完成,但也可以通过脚本编制来完成。本文的“附件”部分包括可以运行或修改的日志收集器示例,以满足大多数需求。
脚本详细信息:
C:\Users\<Current User>\AppData\Roaming\
9af4c403c997dcebdba49b6251565a5c
3a8bb6d3a75ebe14ffc631fe68dcfa308eaf3691
4917c7f2e0d8d6111159cfe18b8dc9ca6cf04ff4467166d65435e3b8e07a5e2b
.cmd
文件显示为记事本图标,并在双击时打开为记事本
.cmd
和其他脚本文件。.bat
而是文件?
.cmd
和 .bat
包含上下文和安全性差异的文件。.cmd
。.bat
。.txt
文件是否包含?
日志已收集 | ZIP 日志路径 | 使用的命令 | 需要管理员 | 命令类型 | Microsoft/戴尔参考 URL | 2.3 更改 |
---|---|---|---|---|---|---|
应用程序事件日志 | \Logs\OperatingSystem\Event Logs\application_eventlog.evtx |
wevtutil epl Application /q:"*[System[(Level<=5)]]" application_eventlog.evtx |
否 | 命令行 | https://learn.microsoft.com/windows/win32/wes/windows-event-log |
0 |
Appx 软件包列表 | \Logs\Application\installed_appx.txt |
Get-AppxPackage | Select PackageFullName | Sort PackageFullName |
Yes | PowerShell | https://learn.microsoft.com/powershell/module/appx/get-appxpackage?view=windowsserver2022-ps |
0 |
可用的睡眠状态列表 | \Logs\Power\available_sleepstates.txt |
powercfg /a |
否 | 命令行 | https://learn.microsoft.com/windows-hardware/design/device-experiences/powercfg-command-line-options |
0 |
电池报告 | \Logs\Power\Battery_Report.html |
powercfg /batteryreport /output Battery_Report.html /duration 14 |
Yes | 命令行 | https://learn.microsoft.com/windows-hardware/design/device-experiences/powercfg-command-line-options |
0 |
BCD 信息 | \Logs\OperatingSystem\bcd.txt |
bcdedit |
Yes | 命令行 | https://learn.microsoft.com/windows-server/administration/windows-commands/bcdedit |
0 |
Bitlocker 保护程序列表 | \Logs\Security\bitlocker_PCRs.txt |
manage-bde %SYSTEMDRIVE% -protectors -get -type TPM |
Yes | PowerShell | https://learn.microsoft.com/windows-server/administration/windows-commands/manage-bde |
0 |
Bitlocker 状态 | \Logs\Security\bitlocker_status.txt |
manage-bde -status |
Yes | PowerShell | https://learn.microsoft.com/windows-server/administration/windows-commands/manage-bde |
0 |
宽带适配器列表 | \Logs\Network\broadband_adapter.txt |
netsh mbn show interfaces |
否 | 命令行 | https://learn.microsoft.com/windows-server/networking/technologies/netsh/netsh-contexts |
0 |
已配置唤醒计时器列表 | \Logs\Power\waketimers.txt |
powercfg /waketimers |
Yes | 命令行 | https://learn.microsoft.com/windows-hardware/design/device-experiences/powercfg-command-line-options |
0 |
Dell Command Update 日志 | \Logs\Dell\Dell_Command_Update\Activity.log |
XCOPY /s /y /q /F %SYSTEMDRIVE%\ProgramData\Dell\UpdateService\Log |
Yes | 命令行 | Dell Command | Update | 0 |
Dell Data Migrate 日志(目标) | \Logs\Dell\Dell_Data_Migrate_Destination\(Various files) |
XCOPY /s /I /y /q /F %SYSTEMDRIVE%\ProgramData\Dell\SupportAssist\CDM\Logs . |
Yes | 命令行 | https://www.dell.com/support/manuals/data-assistant/migrate_1.0_ug/ | 0 |
戴尔数据迁移日志(源) | \Logs\Dell\Dell_Data_Migrate_Source\(Various Files) |
XCOPY /s /y /q /F %SYSTEMDRIVE%\ProgramData\DDA\logs\ . |
Yes | 命令行 | https://www.dell.com/support/manuals/data-assistant/migrate_1.0_ug/introduction?guid=guid-28c0bb91-e84d-4118-99ee-e5500769b170& | 0 |
Dell Digital Delivery 日志 | \Logs\Dell\Dell_Digital_Delivery\ |
XCOPY /s /y /q /F %SYSTEMDRIVE%\ProgramData\dell\D3\Resources\Logs\ |
Yes | 命令行 | https://www.dell.com/support/contents/article/product-support/self-support-knowledgebase/software-and-downloads/download-center/dell-digital-delivery | 0 |
戴尔出厂负荷信息 | \Logs\Dell\FactoryLoad\dell.sdr |
XCOPY /y /q /F %SYSTEMDRIVE%\dell.sdr |
否 | 命令行 | https://learn.microsoft.com/windows-server/administration/windows-commands/xcopy |
0 |
Dell Optimizer 戴尔智能调优软件日志 | \Logs\Dell\Dell_Optimizer\* |
*XCOPY command copies multiple AppData files specific to Dell Optimizer* |
否 | 命令行 | https://learn.microsoft.com/windows-server/administration/windows-commands/xcopy |
1 |
Dell Update Package 日志 | \Logs\Dell\Dell_Update_Package\* |
XCOPY /s /y /q /F %SYSTEMDRIVE%\ProgramData\Dell\UpdatePackage\Log . |
否 | 命令行 | Dell Command | Update | 0 |
详细的驾驶员报告 | \Logs\Driver\driver_details.txt |
Get-WmiObject Win32_PnPSignedDriver | select * |
否 | PowerShell | https://learn.microsoft.com/previous-versions/windows/desktop/legacy/aa394354(v=vs.85) |
0 |
DirectX 诊断日志 | \Logs\Graphics\DXdiag.txt |
dxdiag.exe /t DXdiag.txt |
否 | 命令行 | https://support.microsoft.com/windows/open-and-run-dxdiag-exe-dad7792c-2ad5-f6cd-5a37-bf92228dfd85 |
0 |
驱动程序列表 | \Logs\Driver\driver_list.txt |
Get-WmiObject Win32_PnPSignedDriver| select devicename, driverversion, driverdate | Sort-Object devicename |
否 | PowerShell | https://learn.microsoft.com/previous-versions/windows/desktop/legacy/aa394354(v=vs.85) |
0 |
驱动程序存储列表 | \Logs\Driver\driver_store.txt |
dism /online /get-drivers /all /format:table |
Yes | 命令行 | https://learn.microsoft.com/windows-hardware/manufacture/desktop/what-is-dism?view=windows-11 |
0 |
驱动程序处于错误状态 | \Logs\Driver\error_state_drivers.txt |
Pnputil /enum-devices /problem /ids |
否 | 命令行 | https://learn.microsoft.com/windows-hardware/drivers/devtest/pnputil |
1 |
能源报告 | \Logs\Power\energy.html |
powercfg /energy /output energy.html |
Yes | 命令行 | https://learn.microsoft.com/windows-hardware/design/device-experiences/powercfg-command-line-options |
0 |
组策略对象 | \Logs\OperatingSystem\GPO_List.html |
start /min gpresult /H GPO_List.html |
否 | 命令行 | https://learn.microsoft.com/windows-server/administration/windows-commands/gpresult |
0 |
已安装应用程序列表 | \Logs\Application\installed_apps.txt |
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Sort-Object InstallDate |
否 | PowerShell | https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-itemproperty?view=powershell-7.3 |
0 |
IP 配置 | \Logs\Network\ipconfig_all.txt |
ipconfig /all |
否 | 命令行 | https://learn.microsoft.com/windows-server/administration/windows-commands/ipconfig |
0 |
上次唤醒触发器 | \Logs\Power\lastwake.txt |
powercfg /lastwake |
否 | 命令行 | https://learn.microsoft.com/windows-hardware/design/device-experiences/powercfg-command-line-options |
0 |
内存转储(完整内核) | \Logs\MemoryDumps\memory.dmp |
XCOPY /y /q /F %SYSTEMROOT%\memory.dmp |
否 | 命令行 | https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy |
0 |
内存转储(小型转储) | \Logs\MemoryDumps\*.dmp |
XCOPY /s /I /y /q /F %SYSTEMROOT%\minidump\*.dmp |
Yes | 命令行 | https://learn.microsoft.com/windows-server/administration/windows-commands/xcopy |
0 |
内存转储(状态/详细信息) | \Logs\Operating System\DumpStatus.txt |
IF EXIST %SYSTEMROOT%\memory.dmp |
Yes | 命令行 | https://learn.microsoft.com/windows-server/administration/windows-commands/if |
0 |
内存管理状态 | \Logs\System\MemoryManagement.html |
Get-mmagent | Out-File MemoryManagement.html |
Yes | PowerShell | https://learn.microsoft.com/powershell/module/mmagent/get-mmagent?view=windowsserver2022-ps |
1 |
Microsoft 系统信息 (MSinfo32) | \Logs\OperatingSystem\msinfo32.nfo |
start msinfo32 /nfo msinfo32.nfo |
否 | 命令行 | https://support.microsoft.com/topic/description-of-microsoft-system-information-msinfo32-exe-tool-10d335d8-5834-90b4-8452-42c58e61f9fc |
0 |
显示器信息 | \Logs\Graphics\monitor.txt |
Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorID | ForEach-Object {if ($_.UserFriendlyNameLength -gt 0) {($_.ManufacturerName -ne 0 | foreach {[char]$_}) + [char] 10 + 'InstanceName: ' + ($_.InstanceName) + [char] 10 + ($_.UserFriendlyName -ne 0 | foreach {[char]$_}) + [char] 10 + 'Serial: ' + ($_.SerialNumberID -ne 0 | foreach {[char]$_}) + [char] 10 + 'ProdCodeID: ' + ($_.ProductCodeID -ne 0 | foreach {[char]$_}) + [char] 10 + 'WeekOfManufacture:' + $_.WeekOfManufacture + [char] 10 + 'YearOfManufacture:' + $_.YearOfManufacture + [char] 10 + 'DisplayActive:' + $_.Active + [char] 10 -join ''} else{($_.ManufacturerName -ne 0 | foreach {[char]$_}) + [char] 10 + 'InstanceName: ' + ($_.InstanceName) + [char] 10 + ('No Model (Likely Internal LCD)') + [char] 10 + 'Serial: ' + ($_.SerialNumberID -ne 0 | foreach {[char]$_}) + [char] 10 + 'ProdCodeID: ' + ($_.ProductCodeID -ne 0 | foreach {[char]$_}) + [char] 10 + 'WeekOfManufacture:' + $_.WeekOfManufacture + [char] 10 + 'YearOfManufacture:' + $_.YearOfManufacture + [char] 10 + 'DisplayActive:' + $_.Active + [char] 10 -join ''}} |
否 | 否 | https://learn.microsoft.com/windows/win32/wmicoreprov/wmimonitorid |
0 |
网络适配器高级属性日志 | \Logs\Network\net_adapter_adv_properties.txt |
Get-NetAdapterAdvancedProperty |
否 | PowerShell | https://learn.microsoft.com/powershell/module/netadapter/get-netadapteradvancedproperty?view=windowsserver2022-ps |
0 |
作系统版本和安装日期 | \Logs\LogCollectorStatus.txt |
(Get-WMIObject -class Win32_ComputerSystem | Select-Object Model| Format-List | Out-string).Trim(); (Get-WMIObject -class Win32_OperatingSystem | Select-Object Caption, Version| Format-List| Out-string).Trim(); (Write-Output 'OS Install Date:').Trim(); ((Get-Item 'C:\Windows\system.ini').CreationTime | Out-String).Trim() |
否 | PowerShell | https://learn.microsoft.com/windows/win32/cimwin32prov/win32-operatingsystem |
0 |
PnP 设备列表 | \Logs\Operating System\pnp_devices.txt |
Get-CimInstance Win32_PnPEntity |
否 | PowerShell | https://learn.microsoft.com/windows/win32/cimwin32prov/win32-pnpentity |
0 |
电源请求 | \Logs\Power\power_requests.txt |
powercfg /requests |
Yes | 命令行 | https://learn.microsoft.com/windows-hardware/design/device-experiences/powercfg-command-line-options |
0 |
电源方案详细信息 | \Logs\Power\powerschemes.txt |
powercfg /query |
否 | 命令行 | https://learn.microsoft.com/windows-hardware/design/device-experiences/powercfg-command-line-options |
0 |
电源方案列表 | \Logs\Power\power_schemes.html |
powercfg /list |
否 | 命令行 | https://learn.microsoft.com/windows-hardware/design/device-experiences/powercfg-command-line-options |
0 |
进程列表 | \Logs\OperatingSystem\ processes.txt |
Get-WmiObject -Class Win32_Service | Select-Object -Property Name, ProcessID |
否 | PowerShell | https://learn.microsoft.com/powershell/module/scheduledtasks/get-scheduledtask?view=windowsserver2022-ps |
0 |
资源调配包 | \Logs\Application\installed_provisioning_packages.txt |
Get-ProvisioningPackage |
否 | PowerShell | https://learn.microsoft.com/powershell/module/provisioning/get-provisioningpackage?view=windowsserver2022-ps |
0 |
计划任务列表 | \Logs\OperatingSystem\taskscheduler.txt |
Get-ScheduledTask | Where State -ne "Disabled" | Get-ScheduledTaskInfo |
否 | PowerShell | https://learn.microsoft.com/powershell/module/scheduledtasks/get-scheduledtask?view=windowsserver2022-ps |
0 |
服务编号 | Part of File Name |
Get-CimInstance -ClassName Win32_BIOS -Property SerialNumber | Select-Object -ExpandProperty SerialNumber |
否 | PowerShell | https://learn.microsoft.com/windows/win32/cimwin32prov/win32-bios |
0 |
服务编号和底板 ID | \Logs\System\System_Board.txt |
Get-CimInstance -ClassName Win32_BaseBoard | Format-List |
否 | PowerShell | https://www.dell.com/support/manuals/data-assistant/migrate_1.0_ug/introduction?guid=guid-28c0bb91-e84d-4118-99ee-e5500769b170 | 1 |
服务列表 | \Logs\OperatingSystem\services.txt |
Get-Service | Sort Status |
否 | PowerShell | https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-service?view=powershell-7.3 |
0 |
睡眠研究报告 | \Logs\Power\sleepstudy.html |
powercfg /sleepstudy /output sleepstudy.html |
Yes | 命令行 | https://learn.microsoft.com/windows-hardware/design/device-experiences/powercfg-command-line-options |
0 |
启动进程列表 | \Logs\Application\startup_processes.txt |
Get-CimInstance Win32_StartupCommand | Select-Object Name, command, Location, User | Format-List |
否 | PowerShell | https://learn.microsoft.com/windows/win32/cimwin32prov/win32-startupcommand |
0 |
存储设备列表 | \Logs\Storage\Disk_Drives.txt |
Get-CimInstance -ClassName Win32_DiskDrive | select * | Format-List |
否 | PowerShell | https://learn.microsoft.com/windows/win32/cimwin32prov/win32-diskdrive |
0 |
存储卷 | \Logs\Storage\Disk_Volumes.txt |
Get-CimInstance -ClassName Win32_DiskPartition | Format-List |
否 | PowerShell | https://learn.microsoft.com/windows/win32/cimwin32prov/Win32-DiskPartition |
0 |
系统型号 | Part of File Name |
Get-WMIObject -class Win32_ComputerSystem | Select-Object -ExpandProperty Model |
否 | PowerShell | https://learn.microsoft.com/windows/win32/cimwin32prov/win32-computersystem |
0 |
TPM 信息 | \Logs\Security\tpm.txt |
get-tpm |
Yes | PowerShell | https://learn.microsoft.com/powershell/module/trustedplatformmodule/get-tpm?view=windowsserver2022-ps |
0 |
USB 设备列表 | \Logs\USB\usb_devices.txt |
gwmi Win32_USBControllerDevice |%%{[wmi]($_.Dependent)} | Sort Manufacturer,Name,Description,DeviceID | Ft -GroupBy Manufacturer Name,Description,Service,DeviceID |
否 | PowerShell | https://learn.microsoft.com/windows/win32/cimwin32prov/win32-usbcontrollerdevice |
0 |
视频适配器详细信息 | \Logs\Graphics\video.txt |
Get-WmiObject win32_videocontroller | select * |
否 | PowerShell | https://learn.microsoft.com/windows/win32/cimwin32prov/win32-videocontroller |
0 |
视频分辨率详细信息 | \Logs\Graphics\video.txt |
Get-WmiObject win32_videocontroller | select caption, CurrentHorizontalResolution, CurrentVerticalResolution, CurrentRefreshRate, DriverVersion |
否 | PowerShell | https://learn.microsoft.com/windows/win32/cimwin32prov/win32-videocontroller |
0 |
唤醒设备列表 | \Logs\Power\device_wake_armed.html |
powercfg -devicequery wake_armed |
否 | 命令行 | https://learn.microsoft.com/windows-hardware/design/device-experiences/powercfg-command-line-options |
0 |
Windows 系统事件日志 | \Logs\OperatingSystem\Event Logs\system_eventlog.evtx |
wevtutil epl System /q:"*[System[(Level<=5)]]" system_eventlog.evtx |
否 | 命令行 | https://learn.microsoft.com/windows/win32/wes/windows-event-log |
0 |
Windows Systeminfo 日志 | \Logs\LogCollectorStatus.txt |
Systeminfo |
否 | 命令行 | https://learn.microsoft.com/windows-server/administration/windows-commands/systeminfo |
0 |
Windows 更新列表 | \Logs\OperatingSystem\WindowsUpdateLog.txt |
Get-WindowsUpdateLog |
否 | PowerShell | https://learn.microsoft.com/powershell/module/windowsupdate/get-windowsupdatelog?view=windowsserver2022-ps |
0 |
Windows 更新日志 | \Logs\OperatingSystem\hotfixes.txt |
Get-hotfix |
否 | PowerShell | https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-hotfix?view=powershell-7.3 |
0 |
有线网络列表 | \Logs\Network\current_wired_network_interfaces.txt |
netsh lan show interfaces |
否 | 命令行 | https://learn.microsoft.com/windows-server/networking/technologies/netsh/netsh-contexts |
0 |
有线网络配置文件 | \Logs\Network\wired_profiles.txt |
netsh lan show profiles |
否 | 命令行 | https://learn.microsoft.com/windows-server/networking/technologies/netsh/netsh-contexts |
0 |
有线网络设置 | \Logs\Network\wired_settings.txt |
netsh lan show settings |
否 | 命令行 | https://learn.microsoft.com/windows-server/networking/technologies/netsh/netsh-contexts |
0 |
无线报告 | \Logs\Network\wlan-report-latest.html |
netsh wlan show wlanreport duration=30 && copy /y %ProgramData%\microsoft\windows\wlanreport\wlan-report-latest.html . && copy /y %ProgramData%\Microsoft\Windows\wlanreport\wlan-report-latest.cab . |
Yes | 命令行 | https://learn.microsoft.com/windows-server/networking/technologies/netsh/netsh-contexts |
0 |
Windows 升级/刷新 | \Logs\OperatingSystem\windows_upgrade_history |
get-itemproperty -path 'HKLM:\SYSTEM\Setup\Source OS*' | SELECT PSChildName, Productname, ReleaseId, DisplayVersion, CurrentBuild |
PowerShell | https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-itemproperty?view=powershell-7.4 |
1 | |
显示流压缩 | Logs\Graphics\Display_Stream_Compression_status.txt |
REG QUERY HKLM\SYSTEM\CurrentControlSet\Control\Class /s /v DPMstDscDisable > Display_Stream_Compression_status.txt |
否 | PowerShell | https://learn.microsoft.com/windows-server/administration/windows-commands/reg-query |
1 |
PCIe 设备生成和链路速度 | \Logs\System\PCIe_Device_Info.txt |
(Get-WMIObject Win32_Bus -Filter 'DeviceID like "PCI%%"').GetRelated('Win32_PnPEntity') | foreach { [pscustomobject][ordered]@{Name = $_.Name; ExpressSpecVersion=$_.GetDeviceProperties('DEVPKEY_PciDevice_ExpressSpecVersion').deviceProperties.data;MaxLinkSpeed=$_.GetDeviceProperties('DEVPKEY_PciDevice_MaxLinkSpeed').deviceProperties.data; MaxLinkWidth=$_.GetDeviceProperties('DEVPKEY_PciDevice_MaxLinkWidth').deviceProperties.data; CurrentLinkSpeed=$_.GetDeviceProperties('DEVPKEY_PciDevice_CurrentLinkSpeed').deviceProperties.data; CurrentLinkWidth=$_.GetDeviceProperties('DEVPKEY_PciDevice_CurrentLinkWidth' ).deviceProperties.data} | Where MaxLinkSpeed } | Format-Table -AutoSize; |
否 | PowerShell | https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-wmiobject?view=powershell-5.1 |
1 |
BIOS 设置 | \Logs\System\BIOS_Settings.txt |
Get-CimInstance -Namespace root\dcim\sysman\biosattributes -ClassName EnumerationAttribute | Select-Object AttributeName, CurrentValue, Defaultvalue, PossibleValue |
Yes | PowerShell | https://learn.microsoft.com/powershell/module/cimcmdlets/get-ciminstance?view=powershell-7.4 |
1 |
Dell Command 忽略列表 | \Logs\Dell\Dell_Command_Update\Update_Ignore_List.txt |
REG QUERY HKLM\SOFTWARE\DELL\UpdateService\Service\IgnoreList /s /v InstalledUpdateJson |
否 | PowerShell | https://learn.microsoft.com/windows-server/administration/windows-commands/reg-query |
1 |
Dell Optimizer 戴尔智能调优软件设置 | \Logs\Dell\Dell_Optimizer\user_settings.txt |
do-cli /get |
否 | 命令行 | https://www.dell.com/support/manuals/dell-optimizer/dell-optimizer-4.0_ug/command-line-interface-for-dell-optimizer?guid=guid-a82481c9-8abf-4a15-9f2b-6011e36c6b19& |
1 |