> 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/it/knowledge-base/how-to-articles/rename-entra-id-accounts-domain.md).

# Rinominare il dominio degli account Entra ID

Rinomini gli account Entra ID con un nuovo dominio e tenant nel database di Remote Desktop Manager utilizzando uno script SQL fornito.

Se utilizza Remote Desktop Manager con l'integrazione Entra ID e modifica il nome del dominio e il tenant, dovrà modificarli anche nel suo database affinché gli utenti possano accedere.

Può utilizzare lo script SQL riportato di seguito per rinominare gli utenti con il dominio corretto.

{% hint style="success" %}
Innanzitutto si assicuri di disporre di un backup del suo database SQL, poiché dovrà eseguirvi delle modifiche.
{% endhint %}

1. In SSMS, si connetta al suo SQL Server cloud di Azure/on-premises e crei una nuova query. Si assicuri che venga eseguita sul suo database di Remote Desktop Manager e **non** sul suo master.
2. Utilizzi il seguente script con le sue informazioni:

```
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)
```

Se ha modificato il suo tenant Azure, deve anche effettuare quanto segue:

1. Esegua `Select*FROM sys.sysusers` per ottenere l'elenco di tutti gli utenti.
2. Per ogni utente, lo elimini e lo ricrei utilizzando il seguente script:

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

3. Una volta completati i passaggi precedenti, potrebbe essere necessario "reimpostare" la cache modificando il suo piano Azure e ripristinando successivamente il piano precedente, affinché i suoi utenti possano accedere.

Dopo aver completato i passaggi precedenti, il SID conterrà le informazioni attuali e dovrebbe essere in grado di autenticarsi con gli utenti precedenti.


---

# 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/it/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.
