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 VMware.VimAutomation.Storage.Fling.zip 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...
Jun 02, 2016
fling logo of Horizon View Configuration Tool

Horizon View Configuration Tool

version 2.0

The Horizon View Configuration Tool automates Horizon View 6.2 installation and deployment. It removes the complexities and manual steps required for setting up a basic Horizon View deployment.

Mar 29, 2021
fling logo of DoD Security Technical Implementation Guide(STIG) ESXi VIB

DoD Security Technical Implementation Guide(STIG) ESXi VIB

version 7.0_1.0.0

This VIB has been developed to help customers rapidly implement the more challenging aspects of the vSphere STIG. These include the fact that installation is time consuming and must be done manually on the ESXi hosts. In certain cases, it may require complex scripting, or even development of an in-house VIB that would not be officially digitally signed by VMware (and therefore would not be deployed as a normal patch would).

Aug 26, 2013
fling logo of Proactive DRS

Proactive DRS

version 1.0

Proactive DRS was the winning entry in last year's 2012 Open Innovation Contest. We promised that we'd create a fling of the winning entry, and here it is!

Apr 15, 2019
fling logo of Identity Manager Migration/Backup Tool

Identity Manager Migration/Backup Tool

version 1.6

Identity Manager Migration/Backup Tool automates the process of exporting or importing applications and entitlements from one Identity Manager instance to another.

Sep 03, 2014
fling logo of WebCommander


version 3.0

Have you ever wanted to give your users access to certain virtual infrastructure tasks instead of the entire vCenter Client?
WebCommander is a way to do this! WebCommander was designed as a framework to wrap your PowerShell and PowerCLI scripts into an easy-to-access web service.

Oct 14, 2013
fling logo of Application View for vCenter Site Recovery Manager

Application View for vCenter Site Recovery Manager

version 1.0

Application View for vCenter Site Recovery Manager shows the application dependencies between virtual machines in a disaster recovery site. This tool is packaged as a standalone virtual appliance, which can be easily set up in an environment which runs vCenter, vCenter Site Recovery Manager, and vCenter Infrastructure Navigator.

View More