I haven’t found too many resources on leveraging the NetApp PowerShell Cmdlets, and I wanted to start using this toolkit to automate some of the work I do. I noticed an interesting challenge most people received when connecting to their filers or clusters, mainly that Windows domain authentication was required due to an RPC server being unavailable. My goal was to connect to a cluster without the use of Windows authentication, as I want to setup a NetApp controller from scratch. (This excludes joining two nodes as HA partners for an initial cluster setup.)

For reference, I’m using a FAS2520 for my lab where I’ll be testing the majority of NetApp scripts on.

For example, the error in the image below depicts the RPC error.

I realized this wasn’t enough and tried using the -HTTPS switch along with passing credentials to see if I could connect to the filer.

This one seemed to work, and I noticed a nice message from NetApp indicating to use the ‘Connect-NcController’ Cmdlet instead, as I noticed with the ‘Connect-NaController,’ a lot of functionality didn’t appear to work. After connecting via the NcController Cmdlet, I was able to freely modify the cluster with relative ease.

Needed to put a quick patchwerk script together to obtain the management IP and serials from multiple vCenters.

Add-PSSnapin vmware.vimautomation.core

$credentials = Get-Credential

function Get-VIHostInfo
{
    foreach($vmhost in get-vmhost)
    {
        $info = Get-VMHost -Name $vmhost.Name | Select Name,@{n="ManagementIP"; e={Get-VMHostNetworkAdapter -VMHost $_ -VMKernel | ?{$_.ManagementTrafficEnabled} | %{$_.Ip}}}
        $esxiHost = Get-VMHost $vmhost.Name | Get-EsxCli
        Write-Host $vmhost.Name","$esxiHost.hardware.platform.get().SerialNumber","$info.ManagementIP
    }
}

$arrVIServers = "" #Insert vCenter IPs here

foreach($server in $arrVIServers)
{
    Connect-VIServer -Server $server -Credential $credentials
    Get-VIHostInfo
    Disconnect-VIServer -Server $server -Force -Confirm:$false
}