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.
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
Get-Cluster | foreach {get-clusterlog –destination D:\Temp}
nice mister one liner jeff 😉
Whahaha… thanks 🙂