Last post Feb 24, 2014 06:45 PM by AndyW2009
Feb 19, 2014 09:35 PM|AndyW2009|LINK
I need to be able to create a new user in Active Directory. I am making a call to Membership.GetUser(username) to check if the user already exists and if not making a call to Membership.Createuser(username, password, null, null, null, true, guid, out
what is happening is that the application (web process w3wp) is terminating closing down the web application. I have the call wrapped in a try/catch block but it is not throwing an exception.
The windows event log is showing a warning (A process serving the application pool suffered a fatal communication error with the WPAS (Event ID 5011). An error is also logged: Faulting application name w3wp.exe, Model KERNELBASE.dll, Event ID 1000.
My web application is running under a service account - I am assuming that I need to grant some permissions in A/D for this service account to be able to create new users - but I cannot find any documentation around this? Does anyone know specifically
what is required?
Feb 20, 2014 10:27 PM|Terry Guo - MSFT|LINK
Do you have deploy your application to the IIS?
If so, please check the following article to see if this helps:
Event ID 5011 — IIS Application Pool Availability
Feb 24, 2014 06:45 PM|AndyW2009|LINK
Yes, it is an IIS web application.
I found the error is that CreateUser on Membership.Providers["a provider"].CreateUser does not work - it throws an unhandled 'kernel' exception and kills the W3wp process - there appears no way to safetly handle this exception.
The issue presents itself when using multiple membership providers (a usual thing in an enterprise environment). My work-a-round is to set the web.config so that the default provider is the one that I need to use. Doing this allows me to use Membership.CreateUser
which works. However, it creates a new issue in that one can only have a single default provider so the application would not be able to create users in different ActiveDirectory environments (a common enterprise task).