Having an error similar to this Enable-CsUser : Multiple management objects were found for identity “Håkan Karlsson”.?
In my case this occurred when having multiple AD’s that didn’t sync as they should and when moving a user around in my OU’s it got copied at one point instead of moved. In an AD with thousands of users this may become a bit problematic.
Solution 1 – find the duplicate user and remove it
Open PowerShell as admin and (this should be done at the AD server)
PS C:\> Import-Module ActiveDirectory
PS C:\> Get-ADUser -filter {(GivenName -eq "Håkan") -and (Surname -eq "Karlsson")}
This gave me
DistinguishedName : CN=Håkan Karlsson,OU=UnitName,OU=Customers,DC=domain,DC=se
Enabled : True
GivenName : Hakan
Name : Håkan Karlsson
ObjectClass : user
ObjectGUID : 047cf709-0a3f-42f5-a459-b6885c99aace
SamAccountName : hakan
SID : S-1-5-21-54898309-311788698-4246315985-1142
Surname : Karlsson
UserPrincipalName : hakan@domain.se
DistinguishedName : CN=Håkan Karlsson,OU=Sales,OtherUnit,OU=Customers,DC=domain,DC=se
Enabled : True
GivenName : Håkan
Name : Håkan Karlsson
ObjectClass : user
ObjectGUID : 0bae8230-eb34-4119-bc97-bfde80a3dfe4
SamAccountName : User13
SID : S-1-5-21-54898309-311788698-4246315985-1265
Surname : Karlsson
UserPrincipalName : User13@domain.se
There, it’s very easy to track and remove any of these users if I’d like to.
Solution 2 – Keep both users and add by DistinguishedName instead
Even though it’s rarely mentioned you can add users to Lync by their DistinguishedName.
Any given day you would type something like
Enable-CsUser -Identity "Håkan Karlsson" -RegistrarPool "lync.domain.se" -SipAddressType SamAccountName -SipDomain domain.se
Now, that was the command that didn’t work since you have two users by that name. Instead do this
Enable-CsUser –Identity "CN=Håkan Karlsson,OU=Sales,OtherUnit,OU=Customers,DC=domain,DC=se"
-RegistrarPool "lync.domain.se" -SipAddressType SamAccountName -SipDomain domain.se
That’s it.
Lessons learned from this? Always use the DistinguishedName when adding users to lync!