<div class="content"><p>The InstanceName method sets the web <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_1623705d-a7a0-4e46-9a66-66e9ee63d961" data-linktype="relative-path">server instance</a> to be used
by subsequent method calls.</p><dl>
<dd>
<div><pre> [propput, id(4)] HRESULT InstanceName(
   [in] BSTR newVal
 );
</pre></div>
</dd></dl><p><b>newVal: </b>A string that specifies the web server
instance.<a id="Appendix_A_Target_33"></a><a aria-label="Product behavior note 33" href="88fd1df0-e63e-41ca-9bf3-bedcab57cd86#Appendix_A_33" data-linktype="relative-path">&lt;33&gt;</a></p><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>
  <p>0x00000000</p>
  <p>S_OK</p>
  </td>
  <td>
  <p>The call was successful.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x80070057</p>
  <p>E_INVALIDARG</p>
  </td>
  <td>
  <p>One or more arguments are invalid.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x000006cf</p>
  <p>RPC_S_STRING_TOO_LONG</p>
  </td>
  <td>
  <p>The string is too long.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>The <b>opnum</b> field value for this method is 10. </p><p>When processing this call, the server MUST do the following:</p><ul><li><p><span><span> 
</span></span>If the <i>newVal</i> string is empty, return E_INVALIDARG.</p>
</li><li><p><span><span> 
</span></span>If the number of characters in <i>newVal</i> is more than 260,
return RPC_S_STRING_TOO_LONG.</p>
</li><li><p><span><span> 
</span></span>Save the value of the <i>newVal</i> parameter for use in
subsequent calls on the interface. </p>
</li></ul></div>