I have two NA filers that I'm writing a shutdown script to be kicked off by APC PowerChute. Really simple, I just need to Invoke-NaSsh and halt the system. I'm having a problem actually connecting to the filer, though. It appears that the generated PSCredential object (as per "get-help Connect-NaController -examples", example 4) isn't working. When manually invoking the Get-Credential function, the Connect-NaController process runs just fine. Even allocating a separate $cred variable, and outputting the Get-Credential result works. However, the given syntax from the example throws the following error.
Connect-NaController : Could not connect to x.x.x.x on port 80 for protocol HTTP.
It's an absurdly simple script that is meant to run after our SAN-reliant hosts have been shut down. I'm sure I'm missing something completely rudimentary here, but I've never written anything using the DataONTAP Powershell kit, so I'm at a loss. Thanks for any help or advice you can offer!
Establish a connection to a Data ONTAP storage controller. Unless 'Transient' is true, this connection is saved in the global variable CurrentNaController. All other cmdlets in the Data ONTAP PowerShell Toolkit utilize this global variable if their 'Controller' parameter is not explicitly provided.
Connections are established using RPC by default. To use HTTPS (with automatic fallback to HTTP), supply the Credential parameter (see examples) or save credentials in the Toolk it credentials cache.
Use the RPC/HTTP/HTTPS parameters to limit connections to a specific protocol.
Now, I'm not entirely sure why HTTPS claims to have incorrect credentials. This is the exact same object setup. It seems like the correct object isn't being produced. Because, as I mentioned before, when manually invoking Get-Credential and running, everything works, and I get a connection object on $CurrentNaController.