<div class="content" name="SetClientPermissions" uuid="d2ae3199-3aca-46a9-831a-5015b07bd196"><p>The SetClientPermissions method adds or removes a specified
client for remote <a href="e371cc74-bf4c-4870-8afe-5062cc628b4f#gt_1156c8ef-4d49-462b-9f76-aebcb6c57011" data-linktype="relative-path">accounting</a>
on a server and makes the required changes for <a href="e371cc74-bf4c-4870-8afe-5062cc628b4f#gt_ae2a9876-7fed-4f0d-a390-bf78f76c0736" data-linktype="relative-path">DCOM</a> permissions; that is,
it adds the machine account of the <a href="e371cc74-bf4c-4870-8afe-5062cc628b4f#gt_bb8795a8-ff43-416b-976a-6257b68fe7fa" data-linktype="relative-path">accounting client</a> to the
Distributed COM Users group (see <a href="../ms-samr/4df07fab-1bbc-452f-8e92-7853a3c7e380" data-linktype="relative-path">[MS-SAMR]</a>
section <a href="../ms-samr/2c0c5129-c259-452f-81cf-792f1ba2c265" data-linktype="relative-path">3.1.4.2</a>)
of the accounting server.</p><dl>
<dd>
<div><pre> [id(14), helpstring(&#34;method SetClientPermissions&#34;)] HRESULT SetClientPermissions(
   [in] BSTR bstrClientId,
   [in] BOOL fAddPermissions
 );
</pre></div>
</dd></dl><p><b>bstrClientId: </b>A string that identifies the
client machine name whose account is to be added or removed.</p><p><b>fAddPermissions: </b>TRUE to add and FALSE to
remove.</p><p><b>Return Values: </b>This method returns 0x00000000
for success, or a negative <a href="e371cc74-bf4c-4870-8afe-5062cc628b4f#gt_799103ab-b3cb-4eab-8c55-322821b2b235" data-linktype="relative-path">HRESULT</a>
value (in the following table or in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>
section <a href="../ms-erref/705fb797-2175-4a90-b5a3-3918024b10b8" data-linktype="relative-path">2.1.1</a>)
if an error occurs.</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>Operation successful.</td>
 </tr><tr>
  <td>0xC1FF0213 WRM_ERR_INVALID_DBSERVER_NAME</td>
  <td>Could not establish a connection to the database server. Either the server name is invalid or the machine executing this method does not have permission to perform an account lookup.</td>
 </tr><tr>
  <td>0xC1FF0214 WRM_ERR_PERMISSION_GRANT_UNSUCCESSFUL</td>
  <td>Could not grant permissions to the current machine to log data remotely. This error is returned when a server machine denies access to a requesting machine.</td>
 </tr></tbody></table>
</dd></dl><p>It is possible for multiple WSRM servers to have a common <a href="e371cc74-bf4c-4870-8afe-5062cc628b4f#gt_00ade642-0391-435b-980a-8fb488ef1b68" data-linktype="relative-path">accounting server</a>. </p><p><b>Note</b>  Remote accounting is not supported in
a workgroup environment.</p><p>Additional <a href="d5942816-752f-480a-9712-38ef0a248b6a" data-linktype="relative-path">IWRMAccounting</a> interface
methods are specified in section 3.2.4.3.</p></div>