Please provide your feedback in this short Flings' survey.
fling logo of PowerCLI Cmdlet for NFS

PowerCLI Cmdlet for NFS

version 1.0 — April 21, 2015

The functionality of this Fling is integrated into PowerCLI 6.0 R2. Whenever possible, use the latest supported version of PowerCLI, which can be downloaded here.


VMware PowerCLI is one of the most successful command line tools for managing your VMware products. With many existing cmdlets designed for the system administrator or vSphere Admin, PowerCLI is the easiest and most powerful tool for managing your environment.

In the recent release of vSphere 6.0, we announced new features like NFS 4.1 support. This Fling adds a PowerShell module with PowerCLI cmdlets for managing vSphere NFS Users, required for the Kerberos-based authentication process of NFS version 4.1 Datastore. The Fling is an extension module for the PowerCli 6.0R1 release.

You can load this Fling as a module to your PowerCli 6.0R1 installation. To see how to install, please follow the Instructions section of this Fling.


  • vSphere 6.0
  • Windows operating system
  • .NET version 4.5 or later
  • Powershell version 3 or later
  • PowerCli 6.0R1


  1. Unzip to some location (say: C:\Dev\)
  2. Run PowerCli
  3. Run the following commands in PowerCli:
    C:\PS>$env:PSModulePath = $env:PSModulePath + ";C:\Dev\"
    C:\PS>import-module VMware.VimAutomation.Storage.Fling
    C:\PS>get-command -Module VMware.VimAutomation.Storage.Fling

To see how you can manage NFS 4.1 features in the vSphere 6.0 release using existing and new cmdlets, see the following workflow:

NFS v4.1 Workflow using PowerCLI:

# Variables
> $vmhost = Get-VMHost 'host_ip'
> $ntp1 = 'ntp_server_ip'
> $dns1 = 'dns_server_1_ip'
> $dns2 = 'dns_server_2_ip'
> $dnsSearch = 'search_dns_domain_name'
> $domain = 'active_directory_domain_name'
> $ADuser = 'user_name'
> $ADpasswd = 'password'

# Set up NTP servers
> add-vmhostntpserver -vmhost $vmhost -ntpserver $ntp1

# Set DNS server and search domain
> $vmhostnetwork = get-vmhostnetwork -vmhost $vmhost
> set-vmhostnetwork -network $vmhostnetwork -DnsFromDhcp $false -dnsaddress $dns1,$dns2 -DomainName $dnsSearch -searchdomain $dnsSearch

# Join the machine to the domain
> $getvmhost | get-vmhostauthentication | Set-VMHostAuthentication -JoinDomain -Domain $domain -Username $ADuser -Password $ADpasswd -confirm:$false

# Get the user credentials (provide username, password, in the window)
> $credential = Get-Credential

# Create an NFS user on the VMHost
> New-NfsUser -VMHost $vmhost -Credential $credential

# Create an NFS v4.1 datastore. New-Nfs41Datastore is a sample function that we provide as a script, along with this fling.
> New-Nfs41Datastore -Name "nfs_datastore_name" -VMHost $vmhost -RemotePath "nfs_datastore_remote_path" -AccessMode readWrite -SecurityType SEC_KRB5 -RemoteHostNames "remote_host_1_ip","remote_host_2_ip"

# Retrieve the datastore
> $ds = Get-Datastore "nfs_datastore_name"

# Remove the datastore
> Remove-Datastore $ds -VMHost $vmhost

# Get NFS User on a VM Host
> $user = Get-NfsUser -VMHost $vmhost

# Update the passowrd of NFS User
> $user = Set-NfsUser -NfsUser $user -Password "new_password"

# Remove the NFS User
> Remove-NfsUser -NfsUser $user

Similar Flings

No similar flings found. Check these out instead...
Nov 10, 2021
fling logo of Community NVMe Driver for ESXi

Community NVMe Driver for ESXi

version 1.2

This Fling is a collection of ESXi Native Drivers which enables ESXi to recognize and consume various NVMe-based storage devices. These devices are not officially on the VMware HCL and have been developed to enable and support the VMware Community.

Feb 05, 2019
fling logo of ESXi Embedded Host Client

ESXi Embedded Host Client

version 1.33.1

This version of the ESXi Embedded Host Client is written purely in HTML and JavaScript, and is served directly from your ESXi host and should perform much better than any of the existing solutions.

Mar 17, 2021
fling logo of Vmss2core


version 1.0.1

Vmss2core is a tool to convert VMware checkpoint state files into formats that third party debugger tools understand. It can handle both suspend (.vmss) and snapshot (.vmsn) checkpoint state files (hereafter referred to as a 'vmss file') as well as both monolithic and non-monolithic (separate .vmem file) encapsulation of checkpoint state data.

Jul 19, 2016
fling logo of VMware Modified Enhanced SCAP Content Editor

VMware Modified Enhanced SCAP Content Editor

version 1.0

VMware Modified Enhanced SCAP Content Editor is an updated version of the Enhanced SCAP Content Editor too by G2, Inc, and is an open source project, vmware-scap-edit, on GitHub.

Feb 28, 2017
fling logo of VMware vSphere Compatibility Predictor

VMware vSphere Compatibility Predictor

version 1.0.1

This Fling scans all PSCs connected to a single PSC. It will detect the versions of all the vCenter Servers connected to PSCs and all the Solutions connected to vCenter Servers. It will then depict the connectivity in pictorial form.

May 20, 2022
fling logo of Python Client for VMC on AWS

Python Client for VMC on AWS

version 1.8.0

Python Client for VMware Cloud on AWS is an open-source Python-based tool. Written in Python, the tool enables VMware Cloud on AWS users to automate the consumption of their VMware Cloud on AWS SDDC. Note this is not to interact with your VMware Cloud on AWS vCenter but to run tasks such as creating and deleting networks, setting up security groups and services and building network security rules on the Management and Compute Gateways.

View More