> For the complete documentation index, see [llms.txt](https://docs.lithnet.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lithnet.io/resource-management-powershell/usage/cmdlet-reference/set-resourcemanagementclient.md).

# Set-ResourceManagementClient

### Description

The `Set-ResourceManagementClient` cmdlet controls how the module connects to the FIM/MIM service. Call it before using other cmdlets to connect to a remote service, use alternate credentials, or select a specific connection mode. If it is not called, the client connects to the service on the local computer using default settings.

The connection mode is selected automatically from the scheme of the `-BaseAddress` URI, or can be forced with the `-ConnectionMode` parameter. See [Connecting to the MIM service](/resource-management-powershell/installation/connecting-to-the-service.md) for an overview of the modes, and the [connection guide](https://github.com/lithnet/resourcemanagement-client/wiki/Connection-guide) for the server-side setup steps.

### Syntax

```
Set-ResourceManagementClient [-BaseAddress] <string> [[-Credentials] <PSCredential>] [[-ServicePrincipalName] <string>]
    [-ConnectionMode <ConnectionMode>] [-RefreshSchema] [-UsernamePassthrough] [-ConcurrentConnectionLimit <int>]
    [-ConnectTimeoutSeconds <int>] [-ReceiveTimeoutSeconds <int>] [-SendTimeoutSeconds <int>]
```

### Parameters

**BaseAddress**

Required. The address of the resource management service, for example `http://mim-service:5725`. A plain hostname is treated as `http://hostname:5725`. The URI scheme selects the connection mode unless the `-ConnectionMode` parameter is specified: `http://` connects directly to the service (Windows PowerShell only), `net.tcp://` connects to the service's net.tcp endpoint, `pipe://` launches the built-in local proxy (PowerShell 7 on Windows), and `rmc://` connects to the Lithnet Resource Management Proxy service on the MIM server

**Credentials**

Optional. By default, the credentials of the currently logged on user are used. Other credentials can be specified using this parameter

**ServicePrincipalName**

Optional. Overrides the service principal name used for authentication. The default is `FIMService/hostname`, which identifies the MIM service. In `RemoteProxy` mode the SPN identifies the proxy service instead, and defaults to `host/hostname`, matching the proxy service's default account; only override it there if the proxy service runs under a custom account

**ConnectionMode**

Optional. Forces a specific connection mode, overriding the automatic selection based on the URI scheme and runtime. Valid values are `Auto`, `DirectWsHttp`, `DirectNetTcp`, `LocalProxy`, and `RemoteProxy`. The default is `Auto`. Approval operations are not supported in `DirectNetTcp` mode, and `DirectWsHttp` is only available in Windows PowerShell

**RefreshSchema**

Optional. Forces the client to reload the service schema after the connection is established

**UsernamePassthrough**

Optional. Passes the username to the service exactly as supplied. By default on non-Windows platforms, the domain suffix of a user principal name is converted to uppercase to match the expected Kerberos realm format

**ConcurrentConnectionLimit**

Optional. The maximum number of concurrent connections the client can open to the service. If not specified, the client default is used

**ConnectTimeoutSeconds**

Optional. The connection timeout, in seconds. If not specified, the client default of 30 seconds is used

**ReceiveTimeoutSeconds**

Optional. How long the client waits for a response from the service, in seconds. Increase this value for long-running operations such as large exports. If not specified, the client default of 20 minutes is used

**SendTimeoutSeconds**

Optional. How long the client waits for a request to be sent to the service, in seconds. If not specified, the client default of 20 minutes is used

### Examples

```powershell
# Connect to the MIM service with a specific URL
Set-ResourceManagementClient -BaseAddress http://mim-service:5725

# Connect using only a hostname (treated as http://mim-service:5725)
Set-ResourceManagementClient -BaseAddress mim-service

# Connect from PowerShell 7 using the built-in local proxy
Set-ResourceManagementClient -BaseAddress pipe://mim-service

# Connect using the remote proxy service installed on the MIM server
Set-ResourceManagementClient -BaseAddress rmc://mim-service

# Connect with a specific address and SPN
Set-ResourceManagementClient -BaseAddress http://mim-service:5725 -ServicePrincipalName FIMService/otherhostname

# Connect to the MIM service, prompting the user for credentials
Get-Credential | Set-ResourceManagementClient -BaseAddress http://mim-service:5725

# Connect to the net.tcp endpoint with an extended receive timeout
Set-ResourceManagementClient -BaseAddress net.tcp://mim-service:5736 -ReceiveTimeoutSeconds 3600
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lithnet.io/resource-management-powershell/usage/cmdlet-reference/set-resourcemanagementclient.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
