How to obtain the user identity on My Profile page of MySite

Had a scenario where in I had to get User Identity of one of my colleague in My Profile page of MySite in MOSS.

Sample Code snippet

------------------------------------

SPSecurity.RunWithElevatedPrivileges(delegate()

{

IPersonalPage page = this.Page as IPersonalPage;

using (SPSite mysitenew = new SPSite(page.PersonalSite.Url))

{

writer.Write("Real User: " + mysitenew.Owner.ToString());

}

});

Comments