Here is the Exception being thrown when we get that error:
Its weird it is a access denied error but it works every now and then so I am not sure why if you go back to back it errors with access denied.
Application Name : New Employee
Process ID : 4712
Date :3/10/2014 10:31:04 AM
Log Level :Error
Log Category :LogicBase.Components.ActiveDirectory.CreateUserComponent
Machine Name : Server Name
Message :
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
--- End of inner exception stack trace ---
at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)
at System.DirectoryServices.AccountManagement.SDSUtils.SetPassword(DirectoryEntry de, String newPassword)
at System.DirectoryServices.AccountManagement.ADStoreCtx.SetPassword(AuthenticablePrincipal p, String newPassword)
at System.DirectoryServices.AccountManagement.SDSUtils.InsertPrincipal(Principal p, StoreCtx storeCtx, GroupMembershipUpdater updateGroupMembership, NetCred credentials, AuthenticationTypes authTypes, Boolean needToSetPassword)
at System.DirectoryServices.AccountManagement.ADStoreCtx.Insert(Principal p)
at System.DirectoryServices.AccountManagement.Principal.Save()
at LogicBase.Components.ActiveDirectory.CreateUserComponent.Run(IData data)