NetDfsGetSupportedNamespaceVersion function

Determines the supported metadata version number.


NET_API_STATUS NET_API_FUNCTION NetDfsGetSupportedNamespaceVersion(
  _In_  PWSTR                                 pName,


Origin [in]

A DFS_NAMESPACE_VERSION_ORIGIN enumeration value that specifies the origin of the DFS namespace version.

pName [in]

A string that specifies the server name or domain name. If the value of the Origin parameter is DFS_NAMESPACE_VERSION_ORIGIN_DOMAIN, this string must be an AD DS domain name. Otherwise, it must be a server name. This parameter is required and cannot be NULL.

ppVersionInfo [out]

A pointer to a DFS_SUPPORTED_NAMESPACE_VERSION_INFO structure that receives the DFS metadata version number.

Return value

If the function succeeds, the return value is NERR_Success.

If the function fails, the return value is a system error code. For a list of error codes, see System Error Codes.


This function is useful in determining an appropriate version number to pass to the NetDfsAddRootTarget function.

The version number of the DFS metadata that can be used for a new DFS namespace depends on the following:

  • For domain-based DFS namespaces, the version supported by the DFS metadata schema that is being used in the AD DS domain.
  • The version supported by the server that is to host the DFS root target.

Thus, the maximum DFS metadata version number that can be used for a new DFS namespace is the minimum of the version supported by the AD DS domain and the version supported by the server. This maximum can be determined by calling the NetDfsGetSupportedNamespaceVersion function with the pName parameter set to the name of the server that is to host the new DFS root target and the Origin parameter set to DFS_NAMESPACE_VERSION_ORIGIN_COMBINED.


Minimum supported client

Windows Vista with SP1

Minimum supported server

Windows Server 2008


LmDfs.h (include LmDfs.h or Lm.h)





See also

Network Management Overview
Network Management Functions
Distributed File System (DFS) Functions