<div class="content" name="Export" uuid="61afee7a-a004-47de-a264-f8e39998b566"><p>The Export method exports a section of the <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_086b13f2-2715-4000-a16c-6acc3d59cc19" data-linktype="relative-path">metabase</a> to a file.</p><dl>
<dd>
<div><pre> HRESULT Export(
   [unique, in, string] LPCWSTR pszPasswd,
   [unique, in, string] LPCWSTR pszFileName,
   [unique, in, string] LPCWSTR pszSourcePath,
   [in] DWORD dwMDFlags
 );
</pre></div>
</dd></dl><p><b>pszPasswd: </b>A pointer to a Unicode string
containing the password that will be used to encrypt any secure properties
being exported.</p><p><b>pszFileName: </b>A pointer to a Unicode string
containing the name of the file, including the directory path, to which the
data will be exported. The path MUST exist and be local to the server.</p><p><b>pszSourcePath: </b>A pointer to a Unicode string
containing the path to the metabase node to be exported.</p><p><b>dwMDFlags: </b>A set of bit flags specifying the
export operation to be performed. It can be zero or one or more of the
following values.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>MD_EXPORT_INHERITED 0x00000001</td>
  <td>Settings inherited from the parent nodes will be included in the export.</td>
 </tr><tr>
  <td>MD_EXPORT_NODE_ONLY 0x00000002</td>
  <td>Child nodes will not be exported.</td>
 </tr></tbody></table>
</dd></dl><p><b>Return Values: </b>A signed 32-bit value that
indicates return status. If the method returns a negative value, it failed. If
the 12-bit facility code (bits 16–27) is set to 0x007, the value contains a
Win32 error code in the lower 16 bits. Zero or positive values indicate
success, with the lower 16 bits in positive nonzero values containing warnings
or flags defined in the method implementation. For more information about Win32
error codes and <a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a>
values, see <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 S_OK</td>
  <td>The call was successful.</td>
 </tr><tr>
  <td>0x80070003 ERROR_PATH_NOT_FOUND</td>
  <td>The system cannot find the path specified.</td>
 </tr><tr>
  <td>0x80070032 ERROR_NOT_SUPPORTED</td>
  <td>The request is not supported.</td>
 </tr></tbody></table>
</dd></dl><p><b>Exceptions Thrown:</b> No exceptions are thrown
beyond those thrown by the underlying <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a> protocol <a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a>.</p><p>The <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_e127848e-c66d-427d-b3aa-9f904fa4ada7" data-linktype="relative-path">opnum</a>
field value for this method is 36. </p><p>When processing this call, the server MUST do the following:</p><ul><li><p><span><span> 
</span></span>If the path passed in the <i>pszFileName</i> parameter does not
exist or is not a path local to the server, return ERROR_PATH_NOT_FOUND.</p>
</li><li><p><span><span> 
</span></span>The server SHOULD validate that the source path provided maps to
a node in the data hierarchy. If it does not, return ERROR_PATH_NOT_FOUND.<a id="Appendix_A_Target_23"></a><a aria-label="Product behavior note 23" href="88fd1df0-e63e-41ca-9bf3-bedcab57cd86#Appendix_A_23" data-linktype="relative-path">&lt;23&gt;</a></p>
</li><li><p><span><span> 
</span></span>If the MD_EXPORT_INHERITED flag is passed, the server MUST
include inherited property values in the exported data.</p>
</li><li><p><span><span> 
</span></span>If the MD_EXPORT_NODE_ONLY flag is passed, the server MUST
include only the specified node and its settings. Child nodes MUST NOT be
included.</p>
</li><li><p><span><span> 
</span></span>Any encrypted data MUST be stored as encrypted with the password
that was provided by the client.</p>
</li></ul></div>