> 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

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 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.devolutions.net/rdm/es/knowledge-base/how-to-articles/rename-entra-id-accounts-domain.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.
