The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to register at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Microsoft Virtualization Discussions

Confused b/c invoke-nassh is lying to me....

JGPSHNTAP

Ok, I'm stumped ...  Putting my script aside, i'm just doing basic work here and it's giving me fits..

Connect-nacontroller $filer

I confirm connection $global:currentnacontroller for sanity check

And then I am just typing a basic command...

invoke-nassh -command "snmp init 0"

And I'm getting thrown this error..

Invoke-NaSsh : Value cannot be null.

Parameter name: Credentials not provided in cmdlet argument, specified controller, or credentials cache.

At line:1 char:13

+ invoke-nassh <<<<

    + CategoryInfo          : InvalidArgument: (:) [Invoke-NaSsh], ArgumentNullException

    + FullyQualifiedErrorId : CredentialsNotSpecified,DataONTAP.PowerShell.SDK.Cmdlets.Toolkit.Ssh.InvokeNaSsh

It's frustrating me to no end!! 

1 ACCEPTED SOLUTION

cknight

Thanks for confirming you use RPC; that makes sense.  Making an RPC connection to a controller is immaterial to using Invoke-NaSsh.  RPC doesn't need explicit credentials, while SSH does.  Both Connect-NaController and Invoke-NaSsh consult the credentials cache, which is why SSH is working for you now.  You could have done any number of things, such as:

* Rely on $global:CurrentNaController using an HTTP/HTTPS connection

Connect-NaController <filer> -HTTPS -Credential <xxx>

Invoke-NaSsh <command>

* Populate the cache

Add-NaCredential <filer> -Credential <xxx>

Invoke-NaSsh <command>

* Specify creds & controller

Invoke-NaSsh -Name <filer> -Credential <xxxx> -Command <command>

* Use a controller variable, as in a loop, without setting the global variable

$filer = Connect-NaController <filer> -HTTPS -Credential <xxx> -Transient

Invoke-NaSsh -Controller $filer -Command <command>

Keep in mind that with the credentials stored in the cache, Connect-NaController will now find that first and establish HTTPS (falling back to HTTP) connections unless you specify -RPC.

View solution in original post

5 REPLIES 5

JGPSHNTAP

Clinton...

I'm all worked out.. I went with your approach.

$filer = Connect-NaController <filer> -HTTPS -Credential <xxx> -Transient

Invoke-NaSsh -Controller $filer -Command <command>

I had it, but was totally blinded that I was connecting via rpc!

Thx for clearing that up with me...

cknight

How are you connecting to the controller?  If you're using RPC, note that SSH is a separate protocol that requires credentials, so you'd have to provide those explicitly.  I'm not sure what else can lead to this condition.

JGPSHNTAP

Clinton,

I am connecting to the filer via rpc.   But if i add the filers via add-nacredential -systemscope invoke-nassh works. 

I think that my concept is wrong.    I am connecting to the controller as above but then invoking nassh.   Thats i think whats throwing me off.

essentially i dont need to connect to controller via connect-nacontroller before i launch the invoke ssh cmdlet. 

cknight

Thanks for confirming you use RPC; that makes sense.  Making an RPC connection to a controller is immaterial to using Invoke-NaSsh.  RPC doesn't need explicit credentials, while SSH does.  Both Connect-NaController and Invoke-NaSsh consult the credentials cache, which is why SSH is working for you now.  You could have done any number of things, such as:

* Rely on $global:CurrentNaController using an HTTP/HTTPS connection

Connect-NaController <filer> -HTTPS -Credential <xxx>

Invoke-NaSsh <command>

* Populate the cache

Add-NaCredential <filer> -Credential <xxx>

Invoke-NaSsh <command>

* Specify creds & controller

Invoke-NaSsh -Name <filer> -Credential <xxxx> -Command <command>

* Use a controller variable, as in a loop, without setting the global variable

$filer = Connect-NaController <filer> -HTTPS -Credential <xxx> -Transient

Invoke-NaSsh -Controller $filer -Command <command>

Keep in mind that with the credentials stored in the cache, Connect-NaController will now find that first and establish HTTPS (falling back to HTTP) connections unless you specify -RPC.

View solution in original post

JGPSHNTAP

Yeah, i was under the assumption that it talks to the credentials cache after it was working.. It just didn't register in my brain fast enough!

Yeah, I can totally add to the credentials cache.  I have the logic in place to handle that as per system login/ID,...

I'm gonna play around and let you know..

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public