Try to get ALUA, Multipath, Advanced TCP and NFS to export control

This is one that I don't know that you've heard before, my script worked yesterday but does not work today. The script part, but I couldn't so he could create a CSV with all data. Today, I am the print below. 3 days ago that I have updated the remote instance of PowerCLI 4.1 to 6.3 update 1. The script was working after the upgrade.

I would like to have the host name appear 1 a the Multipath, then the TCP and NFS info Advanced. Any help would be really appreciated

#Use him below to select more than 1 Virtual Center to run the script against, back on back the #.

param)

[parameter (Mandatory = $true)]

[string []] $vCenter

)

 

$esxHosts = Get-VMHost | Sort Name

foreach ($esx in $esxHosts){

Write-Host 'ALUA and Multipath'

$esxcli . storage . NMP . device . list($null)

Write-Host ' Reading TCP and NFS Advanced Configuration settings on $esx"" "".

 

Get-VMHostAdvancedConfiguration -$vmhost $esx -name * Net.TcpipHeapSize,* Net.TcpipHeapMax,* NFS. HeartbeatMaxFailures,* NFS. HeartbeatFrequency,* NFS. HeartbeatTimeout,* NFS. MaxVolumes

{The } Export-Csv ESX.csv NoTypeInformation - -UseCulture

A I am right now. "

te.jpg

Working last night but not output to CSV

working.jpg

After spending the day working on it some more (masochist), I've gotten to the point of having the output CLOSE to there, but 4 points to solve (and 1 item from the wish list)

1: use of the wish list $Creds automation (for inclusion in all scripts after this one)

2: Data center to display in the name of the report for the reconciliation of the audit

3: host name to display in the csv file,

4: I get out of the name, the keys, the values (just name and values) on the Advanced TCP and NFS parameters

5: am unable to get the Description of export even if I'm the see in the PowerCLI screen for $esxcli.storage.nmp.psp.list)

# TCPandNFS_Settings - TESTS ALL TOGETHER

[CmdletBinding()]

(param

[Parameter (Position = 0, mandatory = $true)]

[System.String]

$VirtualCenterServer,

[Parameter (Position = 1)]

[System.String]

$ClusterName,

[Parameter (Position = 2)]

[System.Boolean]

$asLocalUser = $true

If ((Get - PSSnapin - name VMware.VimAutomation.Core - ErrorAction SilentlyContinue) - eq $null)

Add-PsSnapin VMware.VimAutomation.Core

If ($DefaultVIServers.name - no $VirtualCenterServer)

#Determine if we are connected to VirtualCenter as a local user or if we request identification information

If ($asLocalUser)

SE connect-VIServer-Server $VirtualCenterServer | Out-Null

Write-debug ' connection as a local user in the CR: $VirtualCenterServer.

on the other

SE connect-VIServer-Server $VirtualCenterServer - Credential (Get-Credential). Out-Null

Write-debug ' login as a user manually selected to vc: $VirtualCenterServer.

Write-Host "looks like we are already connected to: $VirtualCenterServer at this session.

If ($ClusterName)

$VMHosts = get-Cluster-name $ClusterName | Get-VMHost | Where-Object {$_.} ConnectionState - eq 'Connected'}

$VMhosts = get-VMHost | Where-Object {$_.} ConnectionState - eq 'Connected'}

$Report =

foreach ($esx in (Get-VMHost))

$esxcli = get-EsxCli - VMHost $esx

Write-Host "reading TCP and NFS Advanced Configuration settings on $esx".

(Get-VMHostAdvancedConfiguration - VMHost $esx - name * Net.TcpipHeapSize, * Net .TcpipHeapMax * NFS.) HeartbeatMaxFailures, * NFS. HeartbeatFrequency, * NFS. HeartbeatTimeout, * NFS. MaxVolumes). GetEnumerator

# Select @{N = "ESX"; E = {$esx. Name}}

Write-Host "ALUA and paths multiple parameters on $esx.

$esxcli.storage.nmp.psp.list)

$Report | Export-Csv "C:\Output.csv" - NoTypeInformation - UseCulture; II 'C:\Output.csv '.

When the $Report is commented out export

Tags: VMware

Similar Questions

Maybe you are looking for