Symptoms
--------------------
System.ArgumentException: Item has already been added. Key in dictionary: 'myDomain'&nbsp Key being added: 'myDomain'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Hashtable.Add(Object key, Object value)
at ManageSoft.Directory.Impl.DirectoryBinder.CacheAllDomains(IManageSoftDatabaseLayer databaseLayer)
at ManageSoft.Directory.Impl.DirectoryBinder.BindToComputerAndUser(IManageSoftDatabaseLayer databaseLayer, String computerName, String computerDomain, String computerFlatDomain, DirectoryEntry computerObject, String userName, String userDomain, Boolean useUniqueNames, Int32& computerID, Int32& computerOUID, Int32& userID, Int32& userOUID)
at ManageSoft.Directory.Impl.DirectoryImpl.BindToComputerAndUser(String computerName, String computerDomain, String computerFlatDomain, String userName, String userDomain, Boolean useUniqueNames, Int32& computerID, Int32& computerOUID, Int32& userID, Int32& userOUID)
at ManageSoft.Inventory.Importer.DatabaseImport.Begin(Inventory i)
at ManageSoft.Inventory.Importer.InventoryImporter.Import(String importType, Stream inputStream, Boolean isGzipped, String sourceIdentifier, String targetFilename, MGSLicenseTermCheckResult licenseCheckResult, ImportProcessingStats& stats)
----
Type: 'System.ArgumentException'
Message: 'Item has already been added. Key in dictionary: 'myDomain' Key being added: 'myDomain''
Source: 'mscorlib'
Cause
OrganizationID | DN | FlatName |
12345 | DC=MyDomain | MyDomain |
67890 |
DC=MyDomain,DC=mycompany,DC=com |
MyDomain |
Resolution
To resolve this issue, simply remove one of the domains. We usually recommend to leave the qualified entry in the database and remove the unqualified entry, an example of a script that could be used is:
DELETE FROM dbo.Domain
WHERE OrganizationID=12345
Additional Information
Make sure to backup the database before you delete any data!
Comments