# Active Directory – The directory service was unable to allocate a relative identifier

I’ve been testing Disaster Recovery scenario restoring Active Directory. One of the servers was restored, and it worked for a moment after restore. If you can regain your Primary DC, it’s best to do so. If you can’t, a standard thing to do during DR is to move all FSMO roles to the restored server so that it can become a master server. You can find out your FSMO holders by using those commands below:

blog

27 Mar 2019 en

![Active Directory – The directory service was unable to allocate a relative identifier](/wp-content/uploads/2019/03/img_5c9bca841df28.png)

[View images (5)](#pf-content-image-1-0)

I've been testing **Disaster Recovery** scenario restoring **Active Directory**. One of the servers was restored, and it worked for a moment after restore. If you can regain your **Primary DC**, it's best to do so. If you can't, a standard thing to do during **DR** is to move all **FSMO** roles to the restored server so that it can become a master server. You can find out your FSMO holders by using those commands below:

```powershell
Get-Adforest | Format-Table DomainNamingMaster, SchemaMaster

Get-ADDomain 'ad.evotec.xyz' | Format-Table InfrastructureMaster, PDCEmulator, RIDMaster
```

[!\[PowerShell output listing FSMO role holders including the RID Master\](/wp-content/uploads/2019/03/img_5c9bca841df28.png)](/wp-content/uploads/2019/03/img_5c9bca841df28.png)

If you're ready, you have confirmed where FSMO roles are stored you can do the force move. This can be done with a single PowerShell command as below.

```powershell
Move-ADDirectoryServerOperationMasterRole -Identity 'YourRestoredDC' -OperationMasterRole 0,1,2,3,4 -Force
```

Notice that I'm using **Force** switch. This switch should only be used in a case where you don't have access to your **FSMO** roles holder! And so I did.

### 💡 What's your problem?

Now the tricky part showed up when I wanted to create a new user for my test purposes. I was greeted with this nice little error message.

> Windows cannot create the object because The directory service was unable to allocate a relative identifier.

It was a bit unexpected because moving **FSMO** roles I've actually moved **RID Master** which should have allowed me to continue. But it didn't.

[!\[Active Directory error stating that the directory service could not allocate a relative identifier\](/wp-content/uploads/2019/03/img_5c9ab15539f10.png)](/wp-content/uploads/2019/03/img_5c9ab15539f10.png)

A quick check with **dcdiag **and indeed rID data seems to be corrupted.

```powershell
dcdiag /test:ridmanager /v
```

[!\[dcdiag ridmanager test output showing RID data corruption\](/wp-content/uploads/2019/03/img_5c9ab17e15b5e.png)](/wp-content/uploads/2019/03/img_5c9ab17e15b5e.png)

### 💡 What's my fix?

Actually, a fix to this is quite simple. I've actually planned to do that later on but it seems not doing so will prevent any changes You have to clean up your Active Directory from old, still down servers. Until you delete them and clean up their metadata it will not let you go any further. You just need to delete them from **Domain Controllers** in **Active Directory Users and Computers **as shown below.

[!\[Active Directory Users and Computers with an old domain controller selected for removal\](/wp-content/uploads/2019/03/img_5c9bcd68977f2.png)](/wp-content/uploads/2019/03/img_5c9bcd68977f2.png)

And finally, remove them from **Active Directory Sites and Services**. After that, you should be good to go and be able to create users again. Short but simple. Just make sure not to delete working servers, and definitely, **don't do it on production** unless you know what you're doing.

[!\[Active Directory Sites and Services showing stale domain controller metadata to delete\](/wp-content/uploads/2019/03/img_5c9bcf5a22a1a.png)](/wp-content/uploads/2019/03/img_5c9bcf5a22a1a.png)

## Related Projects

Projects that align with this post's tags, categories, and content.

[All projects](/projects/)

Matching projects...

[Back to Blog](/blog)

## Related posts

- [Mastering Active Directory Hygiene: Automating Stale Computer Cleanup with CleanupMonster](/blog/mastering-active-directory-hygiene-automating-stale-computer-cleanup-with-cleanupmonster/)
- [Report Active Directory Accounts that are Synchronized with Azure AD](/blog/report-active-directory-accounts-that-are-synchronized-with-azure-ad/)
- [Strengthening Password Security in Active Directory: A PowerShell-Powered Approach](/blog/strengthening-password-security-in-active-directory-a-powershell-powered-approach/)

<!-- PowerForge markdown artifact sha256:F3444CD536724F215CDC5311672FDFA5A55E02576EDD4FD22B45E0F5E8CD408B -->
