1 Reply Latest reply on Nov 1, 2012 7:20 PM by pcombellick

    Determining AF Contact from windows user


      I'm trying to determine the best method for retrieving the AFContact for a user using a specific application, in my case a web application.  


      As an example, when a user launches PI System Explorer, the tool knows what user is using the application and knows the specific AFContact as well (MyPI provides an illustration of this functionality).  In my case I have a web application that is using Windows Integrated Security and as such I can determine the user logged onto the page by looking at Request.ServerVariables["AUTH_USER"].  What is the best method of linking this AD Account user back to their AFContact object?

        • Re: Determining AF Contact from windows user

          Take a look at AFContact.GetCurrentUser().  The AFContact object for the current user is returned. If a contact for the current user does not exist, then null reference (Nothing in Visual Basic) will be returned.


          Or AFContact.FindContact( PISystem , Name);


          The Name or the full CanonicalName of the contact to find. When the full CanonicalName is specified, the AFActiveDirectoryProperties.UserFolder setting is ignored.


          Return Value:  The AFContact in the PISystem which matches the name.