While importing Users from AD Security Groups, the following error occurred: Item has already been added. Key in dictionary

book

Article ID: 184202

calendar_today

Updated On:

Products

Management Platform (Formerly known as Notification Server)

Issue/Introduction

Customer is trying to import Users from a Security Groups or a Distribution Group in AD.

The following entry appears in the NS logs:

"Item has already been added. Key in dictionary: "TEST SMART USERS" Key being added: "TEST SMART USERS" ( Unhandled exception. Type=System.ArgumentException Msg=Item has already been added. Key in dictionary: "TEST SMART USERS" Key being added: "TEST SMART USERS"

Priority: 1
Date: 8/24/2010 12:52:01 PM
Tick Count: 74285234
Host Name: SMPServer
Process: aexsvc.exe (6356)
Thread ID: 7904
Module: AltirisNativeHelper.dll
Source: Altiris.DirectoryServices.DirectoryImport.DirectoryItemImporter.ImportDistributionGroups
Description: System.ArgumentException caught in ImportDistributionGroups. Reason: Item has already been added. Key in dictionary: "TEST SMART USERS" Key being added: "TEST SMART USERS" ( Unhandled exception. Type=System.ArgumentException Msg=Item has already been added. Key in dictionary: "TEST SMART USERS" Key being added: "TEST SMART USERS" Src=mscorlib
StackTrace=
at System.Collections.SortedList.Add(Object key, Object value)
at Altiris.DirectoryServices.DirectoryExport.LDAPExporter.GetGroups(String strServer, String strADFilter, String strUserId, String strPassword, Boolean bUsnChanged, Int32 maxGroups, Boolean cnSecGroups, Int32& nGroupsCount)
at Altiris.DirectoryServices.DirectoryExport.LDAPExporter.GetGroups(String strServer, String strADFilter, String strUserId, String strPassword, Boolean bUsnChanged, Int32 maxGroups, Int32& nGroupsCount)
at Altiris.DirectoryServices.DirectoryExport.LDAPExporter.GetDistributionGroups(String strServer, String strUserId, String strPassword, Int64 nMaxUsnChanged, Boolean usnChanged, FilterType filterType, String filter, Int32 maxGroups, Int32& nGroupsCount)
at Altiris.DirectoryServices.DirectoryImport.DirectoryItemImporter.ImportDistributionGroups() )
 

Cause

Known Issue. There is an issue where multiple Security or Distribution groups with the same name would cause AD connector imports to fail.

Resolution

This issue has been addressed since the SMP 7.0 MR4 and SMP 7.1 MP1 releases.

The current improvements contain a better way to address multiple Security or Distribution groups with the same name. AD connector will use a hierarchical key when sorting the list of groups.

There is a new setting called UseCanonicalNameForDistributionGroups which will cause NS to use canonical naming instead of the usual group name.
The settings UseCanonicalNameForSecurityGroups and UseCanonicalNameForDistributionGroups now only control how the group name is displayed in the SMP Console.

Also, we have reduced the amount of XML used to represent the entire list of groups, this is what was causing the out of memory exceptions.