#Get-NcNfsExport error

1 messages · Page 1 of 1 (latest)

dreamy badger
#

Multiple values are not supported for 'nosuid' option any alternet on this

tardy ermine
#

I'm not seeing that parameter in the syntax:

PS \> Get-Command -Syntax Get-NcNfsExport

Get-NcNfsExport [[-Path] <string>] [-VserverContext <string>] [-Controller <NcController[]>] [-ZapiRetryCount <int>] [<CommonParameters>]

PS \>
dreamy badger
#

with -path it's works but now i have go each vol and see what vol is causing the issue , i m trying to export the nfs export rule

rapid harbor
#

Can you pipe Get-NcVol to Get-NcNfsExport ? (Get-NcVol | Get-NcNfsExport)

tardy ermine
#

maybe. if not directly, you can break it up.

tardy ermine
#

I'm cobbling together a test in a lab

#

First, I installed PowerShell 7+

#
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Find-Module NetApp.ONTAP | Install-Module -SkipPublisherCheck -AllowClobber
Get-module NetApp.ONTAP -ListAvailable | Import-Module
Connect-NcController -Name cluster2.demo.netapp.com
#

prepped 'stuff' and connected the the lab cluster, you can connect directly to an SVM which I generally believe that's best by inherently reducing the domain for error.

#
PS C:\Users\Administrator.DEMO> get-module NetApp.ONTAP -ListAvailable | Select-Object -Property Name,Version

Name         Version
----         -------
NetApp.ONTAP 9.12.1.2302

PS C:\Users\Administrator.DEMO>
PS C:\Users\Administrator.DEMO> Get-NcSystemVersion

NcController             Value
------------             -----
cluster2.demo.netapp.com NetApp Release Bluepaddle__9.7.0: Fri Nov 22 03:07:37 UTC 2019

PS C:\Users\Administrator.DEMO> Get-Command -Module NetApp.ONTAP -Name Get-NcNfs*

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Cmdlet          Get-NcNfsConnectedClient                           9.12.1.23… NetApp.ONTAP
Cmdlet          Get-NcNfsConnectedClientMap                        9.12.1.23… NetApp.ONTAP
Cmdlet          Get-NcNfsConnectedClientSetting                    9.12.1.23… NetApp.ONTAP
Cmdlet          Get-NcNfsExport                                    9.12.1.23… NetApp.ONTAP
Cmdlet          Get-NcNfsExportPolicyRulesByPolicyId               9.12.1.23… NetApp.ONTAP
Cmdlet          Get-NcNfsSecurityFlavor                            9.12.1.23… NetApp.ONTAP
Cmdlet          Get-NcNfsService                                   9.12.1.23… NetApp.ONTAP
Cmdlet          Get-NcNfsServiceMetrics                            9.12.1.23… NetApp.ONTAP

PS C:\Users\Administrator.DEMO>
#
PS C:\Users\Administrator.DEMO> Get-NcNfsExport -VserverContext svm21 | gm

   TypeName: DataONTAP.C.Types.Nfs.ExportsRuleInfo2

Name                MemberType Definition
----                ---------- ----------
Equals              Method     bool Equals(System.Object obj)
GetHashCode         Method     int GetHashCode()
GetType             Method     type GetType()
ToString            Method     string ToString()
Validate            Method     void Validate()
ActualPathname      Property   System.Object ActualPathname {get;set;}
AllowDeviceCreation Property   System.Nullable[bool] AllowDeviceCreation {get;set;}
AllowSuid           Property   System.Nullable[bool] AllowSuid {get;set;}
AnonymousUser       Property   string AnonymousUser {get;set;}
Clients             Property   System.Collections.Generic.List[DataONTAP.C.Types.Nfs.Client] Clients {get;set;}
ExportChownMode     Property   string ExportChownMode {get;set;}
Index               Property   System.Nullable[int] Index {get;set;}
NcController        Property   NetApp.Ontapi.Filer.C.NcController NcController {get;set;}
NtfsUnixSecurity    Property   string NtfsUnixSecurity {get;set;}
Pathname            Property   System.Object Pathname {get;set;}
Policy              Property   DataONTAP.C.Types.Nfs.Policy Policy {get;set;}
Protocols           Property   System.Collections.Generic.List[string] Protocols {get;set;}
RoRule              Property   System.Collections.Generic.List[string] RoRule {get;set;}
RwRule              Property   System.Collections.Generic.List[string] RwRule {get;set;}
SecurityRules       Property   DataONTAP.C.Types.Nfs.SecurityRuleInfo[] SecurityRules {get;set;}
Superuser           Property   System.Collections.Generic.List[string] Superuser {get;set;}
Svm                 Property   DataONTAP.C.Types.Nfs.Svm Svm {get;set;}

PS C:\Users\Administrator.DEMO>
#
PS C:\Users\Administrator.DEMO> Get-NcNfsExport -VserverContext svm21 | Select-Object -Property svm,Pathname,AllowSuid

Svm Pathname        AllowSuid
--- --------        ---------
    /
    /vol/svm21_root
    /vol/vol1
    /vol/vol2
    /vol/vol3
    /vol1

PS C:\Users\Administrator.DEMO>
wise gyro
#

Just a question, it seems that the version in the powershellgallery is not an official Netapp version. It's owned by a "SapanJain", I would not trust this.I still use the version provided by downloads at netapp.com.

#

To answer your question, your versions of the Powershell Module doesn't match the version of the ONTAP you are running. Think the Powershell Module is making API calls that don't exist in the ONTAP version you are running. Rule of thumb is run the same Powershell Toolkit as the ONTAP version running on your filers.

tardy ermine
tardy ermine
pastel night
tardy ermine
#

@wise gyro - I appreciate your secure stance. Thank you @pastel night for providing additional verification.

rapid harbor
#

Try adding the -ONTAPI switch to your Connect-NcController and see if you get the expected results. -ONTAPI tells it to use ZAPI instead of REST. Might help narrow down the issue.