Partager via


SetSharePermissionByString method of the MSFT_NfsServerTasks class

Sets access permissions in XML string format for shares exported by the Windows NFS server.

Syntax

uint32 SetSharePermissionByString(
  [in] string Path,
  [in] string Permission
);

Parameters

Path [in]

Type: string

The local path to the exported share on the Windows NFS server.

Permission [in]

Type: string

The access to be set for the NFS share. The new permissions that are specified here will replace the existing permission settings on the share.

This access must be specified as an XML string. For a sample access string, see the following Remarks section.

For a description of the schema and a sample configuration file, see NfsShareConfig schema.

Remarks

Following is a sample access string that specifies the share permissions:

<?xml version="1.0" encoding="utf-8" ?>
<NfsShareConfig xmlns="https://schemas.microsoft.com/nfs/2011/03/share" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SchemaVersion="1.0">
<PermissionTemplate Name="template2">
    <PermissionList>
      <PermissionEntry>
        <Name Type="NetGroup">newclient</Name>
        <Permission>ReadWrite</Permission>
        <Encoding>Euc-Kr</Encoding>
      </PermissionEntry>
      <PermissionEntry>
        <Name Type="ClientGroup">newclient1</Name>
        <Permission>ReadOnly</Permission>
        <Encoding>Euc-Tw</Encoding>
      </PermissionEntry>
      <PermissionEntry>
        <Name Type="Host" RootAccess="0">newclient2</Name>
        <Permission>No-Access</Permission>
        <Encoding>Euc-Jp</Encoding>
      </PermissionEntry>
    </PermissionList>    
  </PermissionTemplate>
</NfsShareConfig>

Requirements

Minimum supported client
Windows 8
Minimum supported server
Windows Server 2012
Namespace
Root\Microsoft\Windows\NFS
MOF
NfsCimProv.mof
DLL
NfsCimProv.dll

See also

MSFT_NfsServerTasks

MSFT_NfsSharePermission