Application Pool Account Showing


The part does not show the AD information for the currently logged in user.

file attachments


syedabbasmehadi wrote Aug 4, 2009 at 4:06 PM

please change the code as below its working for me now. Attached the screen shot too

WindowsPrincipal _oWinPrincipal = System.Threading.Thread.CurrentPrincipal as WindowsPrincipal;
                        PrincipalContext ctx = new PrincipalContext(ContextType.Domain);

                        UserPrincipal u = new UserPrincipal(ctx);
                        if (_oWinPrincipal != null)
                            string loggedinUserSID = ((WindowsIdentity)_oWinPrincipal.Identity).User.ToString();
                            u = UserPrincipal.FindByIdentity(ctx, IdentityType.Sid, loggedinUserSID);

wrote Aug 4, 2009 at 4:06 PM

wrote Feb 13, 2013 at 1:56 AM