<div class="content" name="SamrConnect4" uuid="c1b14e67-0f46-47a6-9fa7-0689d284afc9"><p>The SamrConnect4 method obtains a handle to a <span><a href="7b2aeb27-92fc-41f6-8437-deb65d950921#gt_62a8c543-5998-480b-8fa7-41a8f04a18e5" data-linktype="relative-path">server
object</a></span>.</p><dl>
<dd>
<div><pre> long SamrConnect4(
   [in, unique, string] PSAMPR_SERVER_NAME ServerName,
   [out] SAMPR_HANDLE* ServerHandle,
   [in] unsigned long ClientRevision,
   [in] unsigned long DesiredAccess
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>The null-terminated NETBIOS name
of the server; this parameter MAY<a id="Appendix_A_Target_45"></a><a aria-label="Product behavior note 45" href="fa61e5fc-f8fb-4d5b-9695-c724af0c3829#Appendix_A_45" data-linktype="relative-path">&lt;45&gt;</a> be
ignored on receipt.</p><p><b>ServerHandle: </b>An RPC context handle, as
specified in section <span><a href="8138c078-d881-4d1f-b378-94b4c34a287a" data-linktype="relative-path">2.2.7.2</a></span>.</p><p><b>ClientRevision: </b>Indicates the revision (for
this protocol) of the client. The value MUST be set to 2 and MUST be ignored. </p><p><b>DesiredAccess: </b>An <span><a href="../ms-dtyp/7a53f60e-e730-4dfe-bbe9-b21b62eb790b" data-linktype="relative-path">ACCESS_MASK</a></span>
that indicates the access requested for <i>ServerHandle</i> on output. See
section <span><a href="e8afb15e-c053-4984-b84b-66877236e141" data-linktype="relative-path">2.2.1.3</a></span> for a
listing of possible values.</p><p>The server MUST behave as with a call to <span><a href="c842a897-0a42-4ca5-a607-2afd05271dae" data-linktype="relative-path">SamrConnect5</a></span>,
with the following parameter values.</p><table><thead>
  <tr>
   <th>
   <p>Parameter name</p>
   </th>
   <th>
   <p>Parameter value</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>ServerName</td>
  <td>SamrConnect4.ServerName</td>
 </tr><tr>
  <td>DesiredAccess</td>
  <td>SamrConnect4.DesiredAccess</td>
 </tr><tr>
  <td>InVersion</td>
  <td>1</td>
 </tr><tr>
  <td>InRevisionInfo</td>
  <td>SAMPR_REVISION_INFO_V1.Revision = {2} SAMPR_REVISION_INFO_V1.SupportedFeatures = {0}</td>
 </tr><tr>
  <td>OutVersion</td>
  <td>Output ignored</td>
 </tr><tr>
  <td>OutRevisionInfo</td>
  <td>Output ignored</td>
 </tr><tr>
  <td>ServerHandle</td>
  <td>SamrConnect4.ServerHandle</td>
 </tr></tbody></table><p> </p></div>