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

Get NFS clients using powershell

cruxrealm

I am wondering if there's a way to get connected nfs clients per volume using powershell.

I see a cmdlet for:

Get-NcCifsConnection

Get-NcIscsiConnection

But nothing for NFS.

If not,  how do I request for feature enhancement for it?

1 ACCEPTED SOLUTION

parisi

Nothing for PowerShell currently, but we do have REST API support for that command.

 

You can find the REST docs and sample commands via: https://clustermgmt-ip/docs/api

 

parisi_0-1600099970883.png

 

You can also generate sample commands in that view. It creates a curl command, as well as a website URL that generates XML output. This is what it would look like:

 

parisi_1-1600100103991.png

 

View solution in original post

3 REPLIES 3

parisi

Nothing for PowerShell currently, but we do have REST API support for that command.

 

You can find the REST docs and sample commands via: https://clustermgmt-ip/docs/api

 

parisi_0-1600099970883.png

 

You can also generate sample commands in that view. It creates a curl command, as well as a website URL that generates XML output. This is what it would look like:

 

parisi_1-1600100103991.png

 

View solution in original post

cruxrealm

Thanks @parisi    I'll use that instead.   But it still would be good if nfs connection can be added to the cmdlet.

parisi

To add to this, since powershell doesn't really do curl or wget anymore, you can use "invoke-restmethod:"

 

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7

 

https://wilsonmar.github.io/powershell-rest-api/

 

Here’s how I got it to work in PS version4:

 

PS C:\Users\Administrator> $pwd = ConvertTo-SecureString "password" -AsPlainText -Force

PS C:\Users\Administrator> $cred = New-Object Management.Automation.PSCredential ('admin', $pwd)

PS C:\Users\Administrator> Invoke-RestMethod -method get -uri "http://10.193.67.10/api/protocols/nfs/connected-clients?svm.name=DEMO&return_timeout=15&return_records=true" -cred $cred

 

records

-------

{@{svm=; node=; server_ip=10.193.67.219; client_ip=10.63.150.51; volume=; protocol=nfs3; _links=}, @{svm=; node=; server_ip=10.193.67.219; client_ip=10.63.150.51; volume=; protocol=nfs3; _links=},...

 

Powershell 6 and later adds -Authentication, which makes the cred part easier.

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