1.2.0 The property 'LastLoginDate' is not supported by the Active Directory membership provider.

Dec 14, 2011 at 6:54 PM
After installing 1.2.0 and attempting to navigate to the FBA User Management page (_layouts/FBA/Management/UsersDisp.aspx) we received the following error in the ULS logs.
  
Unexpected       System.NotSupportedException: The property 'LastLoginDate' is not supported by the Active Directory membership provider.    at System.Web.Security.ActiveDirectoryMembershipUser.get_LastLoginDate()
  
We have built a composite membership provider to handle both FBA users and AD users. To resolve this issue we has to adjust the following lines of code in the FBAUsersView.cs
 
line 116 replaced
row["LastLogin"] = memberuser.LastLoginDate;
with
try
{
     row["LastLogin"] = memberuser.LastLoginDate;
}
catch
{
     row["LastLogin"] = DBNull.Value;
}
 
also replaced
datanewuser["LastLogin"] = memberuser.LastLoginDate; 
with
try
{
     datanewuser["LastLogin"] = memberuser.LastLoginDate;
}
catch
{
     datanewuser["LastLogin"] = DBNull.Value;
}
Hope this helps anybody else who has this problem.
 
Sep 4, 2013 at 12:04 AM
I am having this problem when I click on "FBA User Management" and I am using the AD provider to talk to my AD LDS. I was using the LDAP provider, but that didn't support password changes so I switched to AD provider. Users can change their own passwords now, but my helpdesk staff can't do password resets with "FBA User Management".

I looked for a file called "FBAUsersView.cs" to make the changes you suggest, but do not see that file anywhere. Please help.
Coordinator
Sep 4, 2013 at 3:08 AM
It's in the source code under the code\data folder.

If you're implementing your own custom membership provider though, you should probably handle the LastLoginDate function yourself within the membership provider.
Sep 4, 2013 at 3:19 AM
Thanks collusion.

I'm not a programmer. I'm just a server admin. I just want to be able to use the "FBA User Management" feature.
If I somehow find out how to recompile this by making the changes above, will that just shut off the check for that value and send me on my way? Or is there more to it?

I've tried to look into resources to create a custom membership provider but haven't found much.

The LDAP provider in Sharepoint can't handle password changes, and the AD provider in ASP apparently can't handle lastlogin. I'm stuck and just want a web portal to manage my AD LDS.
Coordinator
Sep 4, 2013 at 3:25 AM
No, I wouldn't expect making the changes above will work for you (but they may, I haven't tried it) - the original poster made a custom membership provider. Unfortunately the existing AD membership providers don't implement the full membership provider functionality and so they don't work with a lot of solutions (usually they are just used to login).

Making a custom AD membership provider that provides this functionality is on my todo list, but unfortunately I wouldn't expect it anytime soon.
Sep 4, 2013 at 4:10 PM
Anyone want to recompile this with the original poster's suggestion for me? I'd be eternally greatful.
I think by just turning off the check for lastlogindate this may work for me.