How To Script PsLogList.EXE To Check Event Logs On Remote Computers

by [Published on 24 Nov. 2010 / Last Updated on 31 Oct. 2009]

This article explains how you can script PsLogList.exe to check Event Logs on Remote Computers and save the output in the CSV format.

Windows Operating Systems (Windows XP and later) ship with a built-in tool to check Event Logs on remote computers. There are three ways to check Event Logs on Remote Computers. This article explains how you can script PsLogList.exe and store Event Logs output in a CSV file.


  • Create a Text File: CompList.TXT
  • Put all the Server names in this file
  • Next, copy the following lines in a file and save it as DSLog.CMD
  • ***START HERE***
  • Echo Off
  • SetLocal EnableDelayedExpansion
  • FOR /F "Tokens=*" %%L IN (CompList.TXT) DO (
  •    SET ServerName=
  •    SET ServerName=%%L
  •    PsLogList.exe \\!ServerName! "Directory Service" -f e -s -d 7 -x > !ServerName!.CSV
  • )
  • ***END HERE***
Execute the script from a computer from which all the computers/servers mentioned in the CompList.TXT are reachable. The PsLogList command mentioned above gathers the Directory Services from each computer mentioned in the CompList.TXT and output is saved in !ServerName!.CSV file.Download PsLogList.exe from here:

See Also

The Author — Nirmal Sharma

Nirmal Sharma avatar

Nirmal Sharma is a MCSEx3, MCITP and was awarded the Microsoft MVP award in Directory Services and Windows Networking. He specializes in Microsoft Azure, Office 365, Directory Services, Failover Clusters, Hyper-V, PowerShell Scripting and System Center products. Nirmal has been involved with Microsoft Technologies since 1994. In his spare time, he likes to help others and share some of his knowledge by writing tips and articles on various sites and contributing to PowerShell-based Dynamic Packs for www.ITDynamicPacks.Net solutions.

Featured Links