locked
How to get Active Directory users information in InfoPath 2010 RRS feed

  • Question

  • Hello everyone,

    I have wasted the whole week but still didn't get any solution. I want to get information like Name, Job Title, department of the user which exists in active directory to infopath 2010 forms. Please note i am using SharePoint Form Library in infopath 2010 and publish to SharePoint Server 2010.

    i used the following url to get users from active directory to SharePoint Form Library

    http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx

    When i create and run the form it gives the following error. What i am missing please please give me the concrete solution, thanks.

     

     Warning

    An error occurred querying a data source.

    Click OK to resume filling out the form. You may want to check your form data for errors.

    A query to retrieve form data cannot be completed because this action would violate cross-domain restrictions.

    If this form template is published to a SharePoint document library, cross-domain access for user form templates must be enabled under InfoPath Forms Services in SharePoint Central Administration, and the data connection settings must be stored in a UDC file in a data connection library in the same site collection.

    If this is an administrator-approved form template, the security level of the form must be set to full trust, or the data connection settings must be stored in a UDC file by using the Manage data connection files option under InfoPath Forms Services in SharePoint Central Administration.

    An entry has been added to the Windows event log of the server.
    Log ID:6932

    Correlation ID:24cc6283-efe1-49e0-bc06-173374c0c89d

    Wednesday, November 2, 2011 10:46 AM

All replies

  • Hello,

    Is there any way to get user information like Job Title, Department, Company from active directory and insert into textbox placed on infopath forms 2010 without writing code. I saw solution for infopath 2007. But i need a solution for infopath 2010.

    Thanks in advance.

    • Merged by Entan Ming Monday, October 31, 2011 3:34 AM same question
    Thursday, October 27, 2011 12:28 PM
  • Hi,

    Just call the SharePoint web service called UserProfileService of SharePoint.

    You can follow the example of this post good post : http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx

    It still works with InfoPath 2010, it is the same princip.

    Hope this helps.


    Visit my blog : http://rmatayron.blogspot.com/
    Thursday, October 27, 2011 12:36 PM
  • Can UserProfileService.asmx be used when the AD Group is setup on the domain controller, which is a separate server from the SP 2010 server?
    Thursday, October 27, 2011 4:07 PM
  • I have a testing server and SharePoint 2010 and active directory is installed on the same server, you are talking about the pre installed UserProfileService.asmx webservice. I have used this but i have one confusion about that. Which of the web service should i use? 'SOAP Webservice' or the 'RESTweb service' when creating data connection in InfoPath2010 for accessing UserProfileService.asmx, thanks.
    Friday, October 28, 2011 4:24 AM
  • Thanks for the reply,

    I have created a UserProfileService using the blog you mentioned. This blog describes SharePoint 2007 not 2010. If there is no difference then please tell me something more about the option number 3 in the specified blog, that which of the webservice should i choose? SOAP Web service or Rest Web Service???

    I have created a Web Service using SOAP Web Serive, I have successfully created UserProfileSerive, at the end i got an error when i open a list and also iam not getting any data from the active directory to the infopath 2010 textbox, may be because of error which is following.

    Warning

    An error occurred querying a data source.
    Click OK to resume filling out the form. You may want to check your form data for errors.
    Hide error details

    A query to retrieve form data cannot be completed because this action would violate cross-domain restrictions.

    If this form template is published to a SharePoint document library, cross-domain access for user form templates must be enabled under InfoPath Forms Services in SharePoint Central Administration, and the data connection settings must be stored in a UDC file in a data connection library in the same site collection.

    If this is an administrator-approved form template, the security level of the form must be set to full trust, or the data connection settings must be stored in a UDC file by using the Manage data connection files option under InfoPath Forms Services in SharePoint Central Administration.

    An entry has been added to the Windows event log of the server.
    Log ID:6932

    Correlation ID:24cc6283-efe1-49e0-bc06-173374c0c89d


    • Edited by Rauf Ab Friday, October 28, 2011 4:54 AM
    Friday, October 28, 2011 4:31 AM
  • I have created a SharePoint 2010 web service (SOAP Web Service), I have successfully created UserProfileSerive, at the end i got an error when i open a list and also I am not getting any data from the active directory to the infopath 2010 textbox, may be because of error. How to get active directory user information like Job Title, Department  and to insert into infopath 2010 textbox. I have followed the following blog.

    http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx

    And error is following.

    Warning

    An error occurred querying a data source.

    Click OK to resume filling out the form. You may want to check your form data for errors.

    A query to retrieve form data cannot be completed because this action would violate cross-domain restrictions.

    If this form template is published to a SharePoint document library, cross-domain access for user form templates must be enabled under InfoPath Forms Services in SharePoint Central Administration, and the data connection settings must be stored in a UDC file in a data connection library in the same site collection.

    If this is an administrator-approved form template, the security level of the form must be set to full trust, or the data connection settings must be stored in a UDC file by using the Manage data connection files option under InfoPath Forms Services in SharePoint Central Administration.

    An entry has been added to the Windows event log of the server.
    Log ID:6932

    Correlation ID:24cc6283-efe1-49e0-bc06-173374c0c89d

    • Merged by Emir Liu Thursday, November 3, 2011 7:29 AM duplicate thread
    Friday, October 28, 2011 5:02 AM
  • Hi ,

     

    Have you enabled the ‘Allow cross-domain data access for user form templates that use connection settings in a data connection file ’ ? If not ,you should change the info path form service settings in Central Administration .

    Open Central Administration >General Application settings>Configure InfoPath  Form Services > Allow cross-domain data access for user form templates that use connection settings in a data connection file .

     

    Thanks,

    Entan Ming

    Monday, October 31, 2011 4:00 AM
  • Thanks for the reply,

    I have enabled "cross-domain data access for user form templates that use connection settings in a data connection file" but no luck. I don't know why it is giving error. I  need more assistance on this issue.

    One thing i want to tell you i didn't use "UDC file in a data connection library" i dont know how to setup UDC Connection. Thats y may be giving an error. Please tell me how to setup UDC Connection, thanks


    • Edited by Rauf Ab Monday, October 31, 2011 4:35 AM
    Monday, October 31, 2011 4:31 AM
  • Thanks for the reply,

    I have enabled "cross-domain data access for user form templates that use connection settings in a data connection file" but no luck. I don't know why it is giving error. I  need more assistance on this issue.

    One thing i want to tell you i didn't use "UDC file in a data connection library" i dont know how to setup UDC Connection. Thats y may be giving an error. Please tell me how to setup UDC Connection, thanks
    Monday, October 31, 2011 4:36 AM
  • Hi ,

     

    In order to convert a data connection to a UDCX file ,you take the actions below:

    1.       Open the Site collection and choose create a document library .Choose the Data Connection library .

    2.       Then design the form in Info Path .Choose manage data connections .

    3.       Choose the data connection >Convert to Data Connection file.

    4.       Then specify the url to the data connection library in the next screen .

    5.       Then the data connection will be saved as a .udcx file in the library .Approve the file in the library .

    6.       Open the Central Administration>General Application Settings>Manage Data Connection Files .

    7.       Upload the .udcx file to the Data Connection library .And choose ‘Allow HTTP access to the file’ .

     

    Thanks,

    Entan Ming

    Monday, October 31, 2011 9:04 AM
  • Hello everyone,

    I have wasted the whole week but still didn't get any solution. I want to get information like Name, Job Title, department of the user which exists in active directory to infopath 2010 forms. Please note i am using SharePoint Form Library in infopath 2010 and publish to SharePoint Server 2010.

    i used the following url to get users from active directory to SharePoint Form Library

    http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx

    When i create and run the form it gives the following error. What i am missing please please give me the concrete solution, thanks.

     

     Warning

    An error occurred querying a data source.

    Click OK to resume filling out the form. You may want to check your form data for errors.

    A query to retrieve form data cannot be completed because this action would violate cross-domain restrictions.

    If this form template is published to a SharePoint document library, cross-domain access for user form templates must be enabled under InfoPath Forms Services in SharePoint Central Administration, and the data connection settings must be stored in a UDC file in a data connection library in the same site collection.

    If this is an administrator-approved form template, the security level of the form must be set to full trust, or the data connection settings must be stored in a UDC file by using the Manage data connection files option under InfoPath Forms Services in SharePoint Central Administration.

    An entry has been added to the Windows event log of the server.
    Log ID:6932

    Correlation ID:24cc6283-efe1-49e0-bc06-173374c0c89d

    Wednesday, November 2, 2011 10:48 AM
  • Thanks,

    the steps you mentioned are compulsory to get users information from active directory????? or should i just create a new data connection at the time of creation of infopath forms will be enough???

    Thanks for your response

    Wednesday, November 2, 2011 11:20 AM
  • I do not find .udcx file anywhere to upload in manage Data Connection File? Where to find it???? thanks.
    Wednesday, November 2, 2011 11:45 AM
  • Hi ,

     

    I have installed AD and my SharePoint 2010 on the same server .And can successfully get user profile using the SOAP service :UserProfileService.asmx without saving the udcx file.The error message you get asks you to perform these actions .

     

    Do  you mean that you cannot find the upload button in the Central Administration ? This UDCX file can be generated in Info path .Open Manage Data Connection >choose the  data connection >Convert to Connection file .Then specify the url to the data connection library where the file will be saved  .Remember to give a name to the file at the end of the url .Then you can upload the udcx file to Central Administration by look up in the data connection library .

     

    Thanks,

    Entan Ming

    Thursday, November 3, 2011 2:09 AM
  • Hello,

    I get your point and trying to do this procedure again. But please tell me one thing that i must convert connection file and to upload in the central administration, otherwise i will not get users from active directory????

    Thanks for your time and patience :).

    Thursday, November 3, 2011 4:33 AM
  • Hi,

     

    InfoPath Forms Services in Microsoft SharePoint Server 2010 form templates can contain connections to external data sources. An error can occur if the security settings are not configured to allow connections to data sources on different domains .In this way ,you have to perform the actions above to store the data connection file in Central Administration .

     

    You should also make sure that your form is set to full trust :Open the form>File>Info>Advanced form options> Security and trust>Full Trust .

     

    For more information ,please refer to this site:

    InfoPath Forms Services data adapter security error query - Event 6932 (SharePoint Server 2010) : http://technet.microsoft.com/en-us/library/ee513088.aspx

     

    Thanks,

    Entan Ming

    Thursday, November 3, 2011 5:35 AM
  • Hello, thanks for the reply

    I have given the full trust in the Form Options-->Security and Trust-->Full trust. When i publish to SharePoint Server and click Add Document it give the following error. I am near to solution please help............. Thank you.

     

    Warning
    An error occurred querying a data source.
    Click OK to resume filling out the form. You may want to check your form data for errors.
    Hide error details
    An error occurred while trying to connect to a Web service.

    An entry has been added to the Windows event log of the server.
    Log ID:5566

    Correlation ID:b9fe5f32-e79a-4816-b7fb-7669ee1e8d15

     

    Thursday, November 3, 2011 6:28 AM
  • Hi ,

     

    One more thing for you to confirm :Have you enabled  ‘Allow user form templates to use authentication information contained in data connection files’ ?

     

    This can be done in :Central Administration >General Application settings>Configure InfoPath forms service .Then Configure InfoPath Forms Services Web Service Proxy settings to configure how to allow browser forms to connect to web services.

     

    Thanks,

    Entan Ming


    • Edited by Entan Ming Thursday, November 3, 2011 7:40 AM
    Thursday, November 3, 2011 7:38 AM
  • Still this error is coming. I done everything to remove this error but no luck :(

    But really thankful to you...............

    Thursday, November 3, 2011 10:42 AM
  • I have made an entry of loop back check in registry settings when i installed SharePoint Server on Windows Server 2008 to run application on the Windows Server 2008. Do you think it can make a problem???

    Thursday, November 3, 2011 12:09 PM
  • Hello Marreena, The UserProfileService will error out within an InfoPath browser form for the following reasons: -DisableLoopbackCheck is not set on every SharePoint server (http://support.microsoft.com/kb/896861) - more specifically: Click Start, click Run, type regedit, and then click OK. In Registry Editor, locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa Right-click Lsa, point to New, and then click DWORD Value. Type DisableLoopbackCheck, and then press ENTER. Right-click DisableLoopbackCheck, and then click Modify. In the Value data box, type 1, and then click OK. Quit Registry Editor, and then restart your computer. Please note this must be performed on each web front end and the servers must be rebooted in order for the change to take effect. -SharePoint is using Anonymous authentication, in which case the UserProfileService will fail. This is by design, as SharPoint cannot retrieve user information if it doesn't know who the user is. SharePoint must use Windows Integrated authentication. Check this setting within SharePoint Central Administration as well as on the IIS SharePoint website (under the website's properties --> Directory Security --> Authentication) If the above two scenarios have been ruled out then please Preview the template while in Design mode. Upon doing so are you able to successfully call the UserProfileService? If so then we can be certain the template is designed correctly since the desired information returns when viewed in the InfoPath Filler / Client. If the UserProfileService information returns successfully within the Filler but still fails in the browser, please try the following: -Launch Internet Explorer -Type the URL of the UserProfileService into the Address bar (http://< site URL >/_vti_bin/userprofileservice.asmx). Does the asmx page return successfully or does it return an error? I look forward to your reply. Kind Regards, AmandaRu-MSFT
    Thursday, November 3, 2011 5:47 PM
  • Hello,

    thanks for your suggestion, I have already implement the first scenario (LoopBackCheck) but how can i check SharePoint Windows Integrated authentication??? Can you please tell me the steps.

    (http://< site URL >/_vti_bin/userprofileservice.asmx) is returning the list like AddColleague, AddLink, etc. and no error is coming.

    Actually i create a web application using "Classic Mode Authentication", "Authentication provider" is set to  "NTLM" and "Allow Anonymous" is Set to "NO" these are the default SharePoint settings.

    For achieving desired results(Getting users from active directory to SharePoint Form Library using InfoPath 2010) should i use "Claim based authentication" or Classic based authentication at the time of creating web application. If Claim based authentication what should be the settings??? "Integrated Windows Authentication" should be "NTLM" or Negotiate (Kerberos)????.

     

    thanks.





    • Edited by Rauf Ab Friday, November 4, 2011 5:05 AM
    Friday, November 4, 2011 4:25 AM
  • So, have you enabled the  cross-domain access for user form templates in Central Administration as described in the message?

    Friday, November 4, 2011 8:50 AM
  • Yes i have enabled from the very beginning when this error occurred.
    Friday, November 4, 2011 9:43 AM
  • Could you please provide more detailed error information with ULS Logviewer?
    Friday, November 4, 2011 9:46 AM
  • Hello,

    I have created a form in InfoPath 2010 to get users information from active directory by using the following blog.

    http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx

    when i preview this form and login from the active directory user. Form is empty. What i am missing???

    I think my form run first on InfoPath 2010 then i will move on sharepoint 2010. because i didn't test on infopath 2010.

    Thanks in advance.

    • Edited by Rauf Ab Friday, November 4, 2011 12:26 PM
    Friday, November 4, 2011 11:45 AM
  • Hello again Marreena,

    Sorry for the delay.  I cannot advise which type of SharePoint security you'll need, as this is depenedant upon your organizational needs.  Here's an article outlining the different authentication methods, hopefully this helps:

    http://technet.microsoft.com/en-us/library/cc262350.aspx

    In regards to your recent question; in order for UserProfileService to work you'll need to verify Central Admin --> Security -->  Specify authentication providers is set for IIS Security = Integrated Windows / NTLM unless you're reliant on Kerberos. 

    You'll also want to verify the setting within IIS Manager.  Select the appropriate SharePoint site within IIS and select "Authentication".  Ensure only Windows Integrated is enabled.

    Please feel free to update this forum thread if you still need assistance.  If this is urgent you may consider opening a Microsoft Support Ticket.

    Regards,

    AmandaRu-MSFT


    Microsoft ProClarity | This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, November 18, 2011 7:00 PM
  • Hi

    Just by creating a DataCOnnection and using the UserProfileService's method named GetUserProfileByName, should return you the parameters of the current user. By associating the returned parameters with the fields on the infopath form will give you what you wanted.

    You could also have rules defined on the form, to make it more customizable.

    Itay Sakuri has an excellent article, which helped me do this when I was in need of similar info.

    Here is the link to the article and that is all you would need. You should be up and running in 20 minutes.

    http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx


    Surendra Singh, MCITP: SharePoint Administrator 2010

    Tuesday, June 19, 2012 9:07 AM
  • This solution throws error in claims mode authentication

    error :5566 and internal error 500 saying unauthorized user .

    just create one field in infopath say people picker field and using userprofile webservice try to get current username and  submit to forms library in claims based environment .

    basically most articles says check loopback registry settings , anonymous access etc


    SPDEV2010

    Tuesday, June 19, 2012 2:09 PM
  • How do i get information like Address,Pager etc which are not default properties of the user which exists in active directory to infopath 2010 forms
    Monday, November 26, 2012 11:28 AM