Hi Team,
I am trying to export cluster info with the below code which I got from the internet (do not remember where I got this). but the below script runs fine and able to export the data required except for Cluster name and its IP address.
As per my understanding it is able to export only the content of “NTNXHost” but not the content of “NTNXClusterInfo” and “NTNXVM”
$report = @()
$NTNXHost = Get-NTNXHost | Select-Object name,hypervisorAddress,clusterUuid,serviceVMId,serviceVMExternalIP,ipmiAddress,serial,blockSerial,blockModel,blockModelName,cpuModel,numCpuCores,numCpuThreads,numCpuSockets,cpuFrequencyInHz,cpuCapacityInHz,memoryCapacityInBytes,hypervisorFullName,hypervisorType
$report+=$NTNXHost
$NTNXClusterInfo = Get-NTNXClusterInfo | Select-Object name,clusterExternalIPAddress
$report+=$NTNXClusterInfo
$report += "`r`n"
$NTNXVM = Get-NTNXVM -SearchString "VM is a Nutanix CVM" | ft vmname,ipAddresses
$report+=$NTNXVM
$report | Export-Csv -Path C:\temp\ClusterInfo.csv -NoTypeInformation -UseCulture
Hence request you to fix this so that I can export the data along with the Cluster Name & Cluster IP?
Note: Before running the above script I am using the below commands to connect to the cluster.
$credentials = Get-Credential -Message "**Enter your Nutanix Admin credentials here**"
$username = $credentials.username
$password = ConvertTo-SecureString $($credentials.GetNetworkCredential().password) -AsPlainText -ForceConnect-NTNXCluster -Server ClusterFQDN -UserName admin -AcceptInvalidSSLCerts -ForcedConnection