Edit

Share via


Set-NfsServerConfiguration

Changes configuration settings for an NFS server.

Syntax

Default (Default)

Set-NfsServerConfiguration
    [-InputObject <CimInstance[]>]
    [-PortmapProtocol <String[]>]
    [-MountProtocol <String[]>]
    [-Nfsprotocol <String[]>]
    [-NlmProtocol <String[]>]
    [-NsmProtocol <String[]>]
    [-MapServerProtocol <String[]>]
    [-NisProtocol <String[]>]
    [-EnableNFSV2 <Boolean>]
    [-EnableNFSV3 <Boolean>]
    [-EnableNFSV4 <Boolean>]
    [-EnableAuthenticationRenewal <Boolean>]
    [-AuthenticationRenewalIntervalSec <UInt32>]
    [-DirectoryCacheSize <UInt32>]
    [-CharacterTranslationFile <String>]
    [-HideFilesBeginningInDot <Boolean>]
    [-NlmGracePeriodSec <UInt32>]
    [-LogActivity <String[]>]
    [-GracePeriodSec <UInt32>]
    [-NetgroupCacheTimeoutSec <UInt32>]
    [-PreserveInheritance <Boolean>]
    [-UnmappedUserAccount <String>]
    [-WorldAccount <String>]
    [-AlwaysOpenByName <Boolean>]
    [-LeasePeriodSec <UInt32>]
    [-ClearMappingCache]
    [-OnlineTimeoutSec <UInt32>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [-PassThru]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-NfsServerConfig cmdlet changes the configuration settings for an existing Network File System (NFS) server.

For some changes to take effect, you must restart Services for NFS. The cmdlet prompts you to restart if necessary.

Examples

Example 1: Set a grace period on a local NFS server

PS C:\> Set-NfsServerConfiguration -NlmGracePeriodSec 45 -GracePeriodSec 240

This command sets the grace period for the NLM protocol to 45 seconds and sets the grace period for NFS v4.1 to 240 seconds on a local NFS server.

Example 2: Set NFS versions on a local NFS server

PS C:\> Set-NfsServerConfiguration -EnableNfsv2 $False -EnableNfsv4 $True -EnableNfsv3 $True

This command disables versions 2 and 3 of the NFS protocol and enables NFS v4.1 on a local NFS server.

Parameters

-AlwaysOpenByName

Specifies whether an NFS server opens files and directories by name, instead of opening by file ID. You can enable this setting for compatibility with filter drivers that intercept requests for opening files and directories by file name, or for applications that rely on directory change notifications to work with NFS shares.

The default value is $False. By default, an NFS server opens files and directories by ID to improve performance.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False
Aliases:OpenByName

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AsJob

Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.

When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet.

The AsJob parameter resembles using the Invoke-Command cmdlet to run a Start-Job command remotely. However, with AsJob, the job is created on the local computer, even though the job runs on a remote computer, and the results of the remote job are automatically returned to the local computer.

For more information about Windows PowerShell background jobs, see about_Jobs and about_Remote_Jobs.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AuthenticationRenewalIntervalSec

Specifies an interval, in seconds, when an NFS server renews authentication.

Parameter properties

Type:UInt32
Default value:600
Supports wildcards:False
DontShow:False
Aliases:interval, renewauthinterval, AuthRenewalInterval, AuthenticationRenewalInterval

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CharacterTranslationFile

Specifies a path for a file that an NFS server uses for character translation.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:translationfile

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Parameter properties

Type:

CimSession[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Session

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ClearMappingCache

Specifies whether to clear the mapping and netgroup cache of an NFS server.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:clearmapcache

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DirectoryCacheSize

Specifies the size of the directory cache, in kilobytes. This value is a multiple of 4.

Parameter properties

Type:UInt32
Default value:128
Supports wildcards:False
DontShow:False
Aliases:dircache, dcache

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableAuthenticationRenewal

Specifies whether an NFS server renews authentication when cached credentials expire.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False
Aliases:renewauth, EnableAuthRenewal

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableNFSV2

Specifies whether an NFS server can export shares via the NFS v2 protocol.

Parameter properties

Type:Boolean
Default value:3
Supports wildcards:False
DontShow:False
Aliases:v2, nfsv2

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableNFSV3

Specifies whether an NFS server can export shares via the NFS v3 protocol.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False
Aliases:v3, nfsv3

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableNFSV4

Specifies whether an NFS server can export shares via the NFS v4.1 protocol.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False
Aliases:v4, nfsv4

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-GracePeriodSec

Specifies a grace period, in seconds, for an NFS server. During this period, clients can reclaim file locks. The value must be at least twice the value specified in the LeasePeriodSec parameter.

The grace period applies to clients connected via the NFS v4.1 protocol.

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:nfsv4graceperiod, GracePeriod

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HideFilesBeginningInDot

Specifies whether an NFS server creates files that have names that begin with a dot (.) as hidden files.

Parameter properties

Type:Boolean
Default value:0
Supports wildcards:False
DontShow:False
Aliases:hidedotfiles, dotfileshidden

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Specifies the input to this cmdlet. You can use this parameter, or you can pipe the input to this cmdlet.

Parameter properties

Type:

CimInstance[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-LeasePeriodSec

Specifies a lease period, in seconds, for an NFS server. The minimum value is 5. The maximum value is 300.

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Lease, LeasePeriod

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LogActivity

Specifies the activities that an NFS server logs for audit purposes. The acceptable values for this parameter are:

  • Mount
  • Unmount
  • Read
  • Write
  • Create
  • Delete
  • Lock
  • Unlock
  • All
  • None

You can specify multiple values. Specify All to log all activities or None to log none of these activities.

Parameter properties

Type:

String[]

Default value:None
Accepted values:mount, unmount, read, write, create, delete, lock, unlock, none, all
Supports wildcards:False
DontShow:False
Aliases:audit

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MapServerProtocol

Specifies one or more preferred underlying transport protocols that an NFS server uses for the User Name Mapping server (MAPSVR) protocol. You must specify at least one of these two values: Tcp and Udp.

Parameter properties

Type:

String[]

Default value:3
Accepted values:tcp, udp
Supports wildcards:False
DontShow:False
Aliases:MapsvrProtocol

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MountProtocol

Specifies one or more preferred underlying transport protocols that an NFS server uses for the Mount protocol. You must specify at least one of these two values: Tcp and Udp.

Parameter properties

Type:

String[]

Default value:3
Accepted values:tcp, udp
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NetgroupCacheTimeoutSec

Specifies a time-out period, in seconds, for an NFS server. An NFS server enforces this time-out on entries in its netgroup cache.

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:NetgroupTimeout, NetgroupCacheTimeout

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Nfsprotocol

Specifies one or more preferred underlying transport protocols that an NFS server uses for the NFS protocol. You must specify at least one of these two values: Tcp and Udp.

Parameter properties

Type:

String[]

Default value:3
Accepted values:tcp, udp
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NisProtocol

Specifies one or more preferred underlying transport protocols that an NFS server uses for the Network Information System (NIS) protocol. You must specify at least one of these two values: Tcp and Udp.

Parameter properties

Type:

String[]

Default value:None
Accepted values:tcp, udp
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NlmGracePeriodSec

Specifies a grace period, in seconds, that an NFS server enforces for the Network Lock Manager (NLM) protocol. The default value is 45.

Parameter properties

Type:UInt32
Default value:45
Supports wildcards:False
DontShow:False
Aliases:lockperiod, nlmgrace, NlmGracePeriod

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NlmProtocol

Specifies one or more preferred underlying transport protocols that an NFS server uses for the NLM protocol. You must specify at least one of these two values: Tcp and Udp.

Parameter properties

Type:

String[]

Default value:None
Accepted values:tcp, udp
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NsmProtocol

Specifies one or more preferred underlying transport protocols that an NFS server uses for the Network Status Manager (NSM) protocol. You must specify at least one of these two values: Tcp and Udp.

Parameter properties

Type:

String[]

Default value:None
Accepted values:tcp, udp
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OnlineTimeoutSec

Specifies a time-out value, in seconds, for an NFS server. An NFS server waits for this length of time for a resource to come online before it processes an incoming request.

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:onlinetimeout, OnlineTimeoutInSeconds

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PortmapProtocol

Specifies one or more preferred underlying transport protocols that an NFS server uses for the Portmap protocol. You must specify at least one of these two values: Tcp and Udp.

Parameter properties

Type:

String[]

Default value:3
Accepted values:tcp, udp
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PreserveInheritance

Specifies whether an NFS server creates inheritable access control entries (ACEs). These ACEs apply to newly created files and folders on NFS shares. The default value is $False for non-inheritable ACEs.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Inheritance

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ThrottleLimit

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-UnmappedUserAccount

Specifies the Windows account that an NFS server uses to represent users who have no mapping configured in the mapping store. By default, an NFS server uses NT AUTHORITY\Anonymous.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:UnmappedAccount

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WorldAccount

Specifies the Windows account that an NFS server uses to represent World/Other permissions on files when it uses AUTH_UNIX security. By default, the NFS server uses the BUILTIN\Everyone account.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:World

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

CimInstance