getting user properties from AD - InfoPath Dev
in

InfoPath Dev

getting user properties from AD

Last post 09-29-2005 10:46 PM by Patrick Halstead. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 09-23-2005 05:24 AM

    getting user properties from AD

    hello,

    i found this site my first time and i hope it`s the right place to ask my questions ;-)

    i wrote my code-behind in visual studio with c#. i can upload my form in a sharepoint-library and anything works fine..... anything? no, only as long as i use the form with the domain administrator account otherwise the code i wrote doesn`t function. the code get the user name and department from active directory. with this information the form gets further infos from a sql-server and write this in different textfields. for all i wrote my own code, but with any user except the administrator the code won`t function. the form has full trust und is signed with a certificat.

    i want to get the infos from ad by any user, who can give me a solution for my problem?

    mfg
    mephisto
    (germany)
  • 09-23-2005 11:26 AM In reply to

    Re: getting user properties from AD

    Are you using System.Environment.UserName in your C# code to get the current user?
    Jason
    http://www.k2distillery.com/
  • 09-24-2005 01:12 PM In reply to

    Re: getting user properties from AD

    Hi Mephisto,
    To use System.Environment.Username your application must run in the Intranet domain. Please check your IE settings to verify that the SharePoint site where it is published is not in the Trusted Sites domain. If it is, the C# code won't have valid permissions to get the username.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 09-26-2005 05:08 AM In reply to

    Re: getting user properties from AD

    hello again,

    thx for your comments ... and yes, i use the System.Environment.Username to get the actual user. then i use the name to find the infomation i need for the form. i didn`t wrote that the other users who loads the form can get their name, the things after that code, the ad access does nit function. so i ever get the name ... that crazy, isn`t it? i don`t understand this behavior, because anything is good with administrator account. the problem seems to be the ad-access ..... ?????

    i hope you have further answers ;-)

    mephisto
  • 09-29-2005 10:46 PM In reply to

    Re: getting user properties from AD

    Hi Mephisto,
    Did you check the IE security settings?

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.