Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, May 12, 2014 12:31 PM
I have been looking around and am not seeing what i need.
I am just wanting to get what is listed in the "Cluster Events" via powershell.
All replies (4)
Monday, May 12, 2014 1:05 PM
$yesterday = (Get-Date) - (New-TimeSpan -Day 2)Get-WinEvent system -ComputerName Computer | Where-Object {$_.TimeCreated -ge $yesterday} | Where-Object {($_.ProviderName -eq "Microsoft-Windows-FailoverClustering")}
This is what i came up with... but i dont know if this is exactly the same info... appears close.
Monday, May 12, 2014 1:21 PM
I don't have access to a cluster to test this with at the moment. But I would think the easiest way to do thiswould be to use the Get-EventLog cmdlet.
http://technet.microsoft.com/en-us/library/ee176846.aspx
Wednesday, May 14, 2014 7:16 AM
Hi,
You can sue the Get-ClusterLog cmdlets to view the cluster log.
The related KB:
Get-ClusterLog
http://technet.microsoft.com/en-us/library/hh847315.aspx
More information:
Failover Clusters Cmdlets in Windows PowerShell
http://technet.microsoft.com/en-us/library/hh847239.aspx
Hope this helps.
Tuesday, May 27, 2014 1:20 PM
After playing around i found out the importance of the filterhashtable on the get-winevent commmand. It increased things in some of my testing by 80 times. Just wanted to inform people that might not be aware of it.
# Uses FilterHashTable
PS C:\>$yesterday = (Get-Date) - (New-TimeSpan -Day 1)
PS C:\>Get-WinEvent -FilterHashTable @{LogName='Windows PowerShell'; Level=3; StartTime=$yesterday}