Powershell script to audit the VMware vCenter\ESXi \ Windows logs.

To troubleshoot the VCenter related issues we usually collect the VMware support logs and if we want to check for any error or specific info , it is very difficult to identify the details  on which appropriate log to check so I wrote the script in which it will unzip the VMware support log and it will ask for the key word to check it in all the log files , once we provided the search key word , it will check and give the output.

Just not only the VMware logs , we can use it for any sort of log searching to easily find the issue.

Once you run the script it will ask for the location of the ZIP file.


Next it will ask for the location to unzip it in to the folder.


It will ask for the search item in the log and I configured context (1) so that it will display a line before and after the message we are searching.


Download the Powershell script from the below link to search it from the ZIP file.

Dropbox or GitHub

Download the Powershell script for directly searching for the content from the folder and not the zip.

Run the below script from the folder you want to search the log.

Dropbox or GitHub

In case we want to check the ESXi logs , one easy way is using the web browser and in this method no need to have vSphere client or web client.




Also I made one more script in which it will ask to connect the ESXi host and it shows the menu in which we have to select the appropriate log type and then search the key word from the log.



Make sure Powercli modules have been installed already and also run the below command.

Add-PSSnapin VMware.VimAutomation.Core

Download the script from the below link

Dropbox or GitHub

Hope it will be helpful to search quickly the logs from the VMware and Windows Environment.

Reference : http://wahlnetwork.com/2015/11/19/auditing-enhanced-esxi-6-0-host-logs-powercli/

This entry was posted in Powershell, VMware, Windows and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s