Error in Webpart

Sep 19, 2009 at 10:21 PM

Hi,

I just wanted to say this will be a really useful webpart for me.  I have edited the Active Directory Controller(s) field  to update my domain info yet still getting errors.  Here is exactly how it reads in there:

 

<?xml version='1.0' encoding='UTF-8'?><domains><domain name='textra.com' path='LDAP://textra.com/DC=10.1.1.24,DC=10.1.6.25' usr='general' pwd='general' /></domains>

 

All the domain info is right but must have something incorrect.

 

Thanks!!

Coordinator
Sep 20, 2009 at 11:30 AM

Hi Jag,

I suppose your username is likeTEXTRA\jag20191 when you are opening Windows. The first part before the antislash is the windows domain name.

So, I think you should write something more like 

<?xml version='1.0' encoding='UTF-8'?><domains><domain name='TEXTRA' path='LDAP://textra.com/DC=textra,DC=com' usr='general' pwd='general' /></domains>

More info here.

Regards,

Alexis

 

 

Sep 20, 2009 at 5:07 PM

Ok, I did have some errors before.  Fixed them and using elevated privileged service account, here is what I have now:

 

<?xml version='1.0' encoding='UTF-8'?><domains><domain name='corp' path='LDAP://corp.domainname.com/DC=corp,DC=domainname,DC=com' usr='corp\service' pwd='welcome' /> </domains>

Getting this error:

 

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at NomineSharePointTools.ADUserEditor.findFromAccountName(String Name) at NomineSharePointTools.ADUserEditor.selectUser()System.Collections.Generic.Dictionary`2.get_Item(TKey key) at NomineSharePointTools.ADUserEditor.findFromAccountName(String Name) at NomineSharePointTools.ADUserEditor.selectUser()Let me know what you think.....

 

 

Sep 20, 2009 at 7:35 PM

Actually, had typo but working now.....

Coordinator
Sep 20, 2009 at 11:23 PM

I think it's a problem of caps.

Can you try to write <domain name='CORP' ...
instead of <domain name='corp' ...
and tell me what you get?

Alexis

Sep 20, 2009 at 11:31 PM

Its working, but the only issue is that it works with the account name I put in the statement above but now other users are not able to login. 

 

<?xml version='1.0' encoding='UTF-8'?><domains><domain name='corp' path='LDAP://corp.domainname.com/DC=corp,DC=domainname,DC=com' usr='corp\service' pwd='welcome' /> </domains>

 

So only the account called service can login to the site.....is there an edit to fix the permissions?

 

Thanks again for the help!

Sep 21, 2009 at 12:06 AM

All is working again, sorry for the confusion.  Required an iisreset /noforce and all worked.

Coordinator
Sep 22, 2009 at 3:13 PM

it's ok :-)

sometimes, relations between sharepoint, sql, iis and ad are a bit hard to understand...

Jan 27, 2010 at 12:40 PM

Hi Alex,

I was delployed the webpart,but when i click the SELECT button ,getting below error :

 

Server Error in '/' Application.

An item with the same key has already been added.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: An item with the same key has already been added.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[ArgumentException: An item with the same key has already been added.]
   System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +51
   System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +291
   NomineSharePointTools.ADUserEditor.CreateChildControls() +1074
   System.Web.UI.Control.EnsureChildControls() +87
   System.Web.UI.Control.PreRenderRecursiveInternal() +44
   System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842



Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

<!-- [ArgumentException]: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at NomineSharePointTools.ADUserEditor.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->

Below is what i  configuration for AD

<?xml version='1.0' encoding='UTF-8'?><domains><domain name='site.com' path='LDAP://siteUsers/DC=site,DC=com' usr='admin' pwd='admin123' /><domain name='site.com' path='LDAP://siteUsers/DC=site,DC=com' usr='admin' pwd='admin123' /></domains>

Please do the needfull,  i am using this webpart in my project, So please do the needfull it was bit urgent.

Waiting your response...

Reagads,

Mansoor

 

 

 

Coordinator
Jan 28, 2010 at 8:25 AM

Hi Mansoor,

You entered two times the same config parameter.

If you have only one domain, just enter :

<?xml version='1.0' encoding='UTF-8'?><domains><domain name='site.com' path='LDAP://siteUsers/DC=site,DC=com' usr='admin' pwd='admin123' /></domains>

Regards,

 

Alexis

Jan 28, 2010 at 11:06 AM

Hi Alex,

Thanks a lot for your quick response,

I made changes in confilg but i m getting below error :

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at NomineSharePointTools.ADUserEditor.findFromAccountName(String Name) at NomineSharePointTools.ADUserEditor.selectUser()

Config file:

<?xml version='1.0' encoding='UTF-8'?><domains><domain name='site.com' path='LDAP://OU=siteUsers/DC=site,DC=com' usr='admin' pwd='admin@123'/></domains>

My System Deatais

Domain Name: site.com

GroupName for users: siteusers

       Description: I created a grop called siteusers and added the users .

Login id: site\admin

pwd: admin123

Regards

Mansoor