Generate log files for all cluster nodes with a PowerShell one liner

Every once in a while I ‘m asked by a customer to troubleshoot issues on clusters (windows clusters or Hyper-V clusters… no difference for the purpose of this post). One of the first things I do is to getting information of which generating and gathering the cluster log files.

I used to logon to every server, create the file, copy it to my laptop and when I had all the files I could start troubleshooting… as you may suspect, this can take some time and is basically ‘manual labor’. How can I automate this a little?

With the following command (run on a node in the cluster) you generate the log files for each node… but are saved on the node you are logged on to. This saves you connecting to all the nodes one by one and generating the files by hand, etc. Glimlach

cluster /cluster:clustername log /gen /copy:.

But… this is done with the use of cluster.exe which is to disappear in a future Windows Server release. How can we do this in PowerShell?
Well… rather easy actually Emoticon met brede lach

Get-Cluster | foreach {get-clusterlog –destination D:\Temp}


  1. Hans Straat says:

    nice mister one liner jeff 😉

  2. Jeff Wouters says:

    Whahaha… thanks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *