Hi
I would like to get a xls or csv report that extract coredump partition, canonnical name and hostname of following list of host.
If no coredump active, it will show on the report not set or not configure.
Here's what I've started:
$Target = Get-Datacenter DCNAME | Get-VMHost | sort Name
Foreach ($vmhost in $Target) {
$esxcli = Get-EsxCli -VMhost $vmhost
#$esxcli.system.hostname.get()
$esxcli.system.coredump.partition.get()
}
Write-Host "Done" -ForegroundColor DarkGreen
This script only extract configured naa devices as coredump without hostname and validation.
Try like this
ForEach-Object -Process {
$esxcli = Get-EsxCli -VMhost $_ -V2
$esxcli.system.coredump.partition.get.Invoke() |
Select @{N = 'HostFQDN'; E = {$esxcli.system.hostname.get.Invoke().FullyQualifiedDomainName}},
@{N = 'CoreDumpActive'; E = {
if ($_.Active) {$_.Active}
else {'None'}
}
},
@{N = 'CoreDumpConfigured'; E = {
if ($_.Configured) {$_.Configured}
else {'None'}
}
}} |
Export-Csv -Path .\coredump-report.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
thanks LucD