> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/rdm/es/knowledge-base/how-to-articles/rename-entra-id-accounts-domain.md).

# Renombrar el dominio de las cuentas de Entra ID

Renombre las cuentas de Entra ID a un nuevo dominio y tenant en la base de datos de Remote Desktop Manager mediante un script SQL proporcionado.

Si utiliza Remote Desktop Manager con la integración de Entra ID y cambia el nombre de su dominio y su tenant, deberá modificarlos en su base de datos para que los usuarios puedan iniciar sesión.

Puede utilizar el script SQL siguiente para renombrar sus usuarios al dominio correcto.

{% hint style="success" %}
Primero, asegúrese de tener una copia de seguridad de su base de datos SQL, ya que deberá realizar modificaciones en ella.
{% endhint %}

1. En SSMS, conéctese a su SQL Server en la nube de Azure/local y cree una nueva consulta. Asegúrese de que se ejecuta en su base de datos de Remote Desktop Manager y **no** en su base de datos master.
2. Utilice el siguiente script con su información:

```
DECLARE @oldDomain as varchar(255) = '@oldDomain'
DECLARE @newDomain as varchar(255) = '@newDomain'

UPDATE UserSecurity
SET Name=replace(Name,@oldDomain,@newDomain),
    UPN=replace(UPN,@oldDomain,@newDomain),
    ExternalID = NULL
WHERE UserType = 0

UPDATE UserProfile
SET Name=replace(Name,@oldDomain,@newDomain)
```

Si ha cambiado su tenant de Azure, también debe hacer lo siguiente:

1. Ejecute `Select*FROM sys.sysusers` para obtener una lista de todos los usuarios.
2. Elimine cada usuario y vuelva a crearlo utilizando el siguiente script:

```
DROP USER [user@domain.com];
CREATE USER [user@domain.com] FROM EXTERNAL PROVIDER;
```

3. Una vez completados los pasos anteriores, es posible que deba "restablecer" la caché cambiando su plan de Azure y volviendo después al plan antiguo para que sus usuarios puedan iniciar sesión.

Tras haber completado los pasos anteriores, el SID contendrá la información actual y debería poder autenticarse con los usuarios antiguos.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/rdm/es/knowledge-base/how-to-articles/rename-entra-id-accounts-domain.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
