
When I am setting up a new user in “active directory users and computers” I like to find a similar user and copy their account. This way I can set the account up faster and I am less likely to miss something. But for the past few months, I have been fighting this active directory error “the name reference is invalid” when trying to copy an account.
I always seem to be in a hurry when this pops up so I try another account to copy and if I have no luck I just set it up from scratch. But today I had enough so I started to dig into what was going on.
Windows cannot create the object “Username” because: The name reference is invalid.
This is the dreaded error I always got. Other people in my department got the same error as well so I knew it did not have anything to do with my computer.

Don’t you just love how Microsoft manages to put no helpful details in their error messages?
The fix

It turns out for us at least the problem was an entry in the “showInAddressBook” attribute of the user we were trying to copy. It looked like this.
CN=All Recipients(VLV)\0ADEL:268e59f1-29e4-4ab2-baf8-a86fac6aa6b4,CN=Deleted Objects,CN=Configuration,DC=DOMAINNAME,DC=com
After removing that value the copy function started to work again.
Maybe it was some legacy thing from an old server because it only seemed to be a problem with older accounts and not new ones. Or maybe just another Office365 issue from when we migrated over. At this point, I can only guess.

Thanks
Happy to help!
Hi, I have the exact same scenario but when I want to delete the delete item in show addressbook I got this error:
Operation failed. Error code: 0x20b5 the name reference is invalid.
000020B5: AtrErr DSID-xxxxx
Do you know why this is happening? So I can’t copy old AD Users anymore..
Sorry Mat but i’m not sure on this one. 🙁
This helped me out a lot today. Thank you!
So many Thanks for this!
How in the world did you clean up after finding this?
Thanks,
Your welcome! I just cleaned them up as I found them. After a while it stop being an issue.
This resolved my issue. In my case there were two lines in that attribute. I deleted both. I think this is from when there was a Exchange server in-house and these attributes just didn’t get cleaned out during the migration or something. Possibly the old Exchange servers were not retired properly and attributes removed. I wasn’t with the firm then so I am not sure what took place when they moved to O365.
I’m glad this helped you! You bring up a good point about an old Exchange servers not being retired properly. I did not think of that.