Hi All,
I am trying to retrieve my Cluster settings using the Get-Cluster Cmdlet and storing the output in a variable.
I then used the method suggested by Don Jones in the HTML reporting book and built a Hash Table containing the properties I am in interested in. However, the output I get is not formatted correctly (or atleast the way I want to see). What am I doing wrong ?
function Get-ClusterInfo { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string]$ClusterName ) $cluster = Get-Cluster -Name $clusterName $props = @{'Cluster Name'=$cluster.Name; 'Cluster Domain'=$cluster.Domain; 'Enable Shared Volumes'=$cluster.EnableSharedVolumes; 'Shared Volumes Root'=$cluster.SharedVolumesRoot; 'Administrative Access Point'=$cluster.AdministrativeAccessPoint; 'Backup In Progress'=$cluster.BackupInProgress; 'Fix Quorum'=$cluster.FixQuorum; 'Witness Dynamic Weight'=$cluster.WitnessDynamicWeight; 'Dynamic Quorum'=$cluster.DynamicQuorum; 'Prevent Quorum'=$cluster.PreventQuorum; 'Quorum Arbitration Time Max (s)'=$cluster.QuorumArbitrationTimeMax; 'Security Level'=$cluster.SecurityLevel; 'Shutdown Timeout In Minutes'=$cluster.ShutdownTimeoutInMinutes; 'Drain On Shutdown'=$cluster.DrainOnShutdown; 'Netft IPSec Enabled'=$cluster.NetftIPSecEnabled; 'Lower Quorum Priority NodeId'=$cluster.LowerQuorumPriorityNodeId; 'Witness Database Write Timeout'=$cluster.WitnessDatabaseWriteTimeout; 'Database Read/Write Mode'=$cluster.DatabaseReadWriteMode; 'Witness Restart Interval'=$cluster.WitnessRestartInterval; 'Recent Events Reset Time'=$cluster.RecentEventsResetTime; 'Message Buffer Length'=$cluster.MessageBufferLength; } New-Object -TypeName PSObject -Property $props }# End of Get-ClusterInfo OUTPUT : PS C:\Users\XXXXX\Documents\Cluster> Get-ClusterInfo -ClusterName USXXXXXX Witness Restart Interval : 15 Enable Shared Volumes : Enabled Recent Events Reset Time : 1/17/2017 10:48:03 PM Dynamic Quorum : 1 Lower Quorum Priority NodeId : 0 Prevent Quorum : 0 Quorum Arbitration Time Max (s) : 20 Witness Database Write Timeout : 300 Cluster Name : USXXXXXXXXX Shutdown Timeout In Minutes : 20 Security Level : 1 Shared Volumes Root : C:\ClusterStorage Cluster Domain : xxx.xxxxxx.com Netft IPSec Enabled : 1 Administrative Access Point : ActiveDirectoryAndDns Database Read/Write Mode : 0 Message Buffer Length : 50 Backup In Progress : 0 Drain On Shutdown : 1 Witness Dynamic Weight : 1 Fix Quorum : 0
PS C:\Users\XXXXX\Documents\Cluster>