When creating a new user object, there are a number of attributes that are 'must have' attributes that must be specified when creating the user object. These attributes are specified in User and subclass objects and definition in attribute called SystemMustContain.
For a standard AD Schema, these are normally ones that must be set:
cn
instanceType
nTsecurityDescriptor
ObjectCategory
ObjectClass
objectSid
Samaccountname
Some of these attrtibutes are automatically populated by AD when not specified, but some are not. It might require a bit of trial and error to find out which attributes are required.
Also 0x80005000 could also mean that the DN path provided for the object creation may not be valid, check that you are providing a valid DN and is matches the attributes that are being set.
Gary.