ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH - 8540 (0x215C)
The source and destination object must be of the same type.
Updated: Feb 21, 2026
Technical Meaning
The error code ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH with the numeric value 8540 and hexadecimal representation 0x215C indicates that an operation attempted to modify or move a directory service object, but the source and destination objects are of different types. This can occur in various Directory Services operations where type consistency is required.
Error Details
This error typically arises when performing actions such as moving or renaming objects within a directory service, where the system expects both the source and target to be of the same object class. For example, attempting to move a user object into a group object would result in this error because users and groups are distinct object classes.
Usage Context
This error is relevant primarily when working with Active Directory or other directory services that manage objects such as users, groups, computers, and organizational units (OUs). It can also appear in custom applications that interact directly with the underlying directory service APIs.
Developer Interpretation
When encountering this error, developers should ensure that operations involving object movement or modification are performed only between objects of the same class. This includes validating input parameters to confirm that both source and destination objects belong to the expected classes before executing any operation.
Related Errors
ERROR_DS_DRA_SCHEMA_MISMATCH(8536): Indicates a schema mismatch issue when replicating data across directory service domains.ERROR_DS_OBJECT_CLASS_VIOLATION(1942): Occurs when an object is created or modified with attributes that do not match its class definition.
FAQ
Q: What does the error code 8540 mean?
A: The error code 8540, ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH, indicates a mismatch between the source and destination object classes during an operation in Directory Services.
Q: How can I resolve this issue?
A: Ensure that both the source and target objects are of the same class before performing any operations such as moving or modifying them. Validate input parameters to confirm type consistency.
Summary
The error ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH (8540) is a specific technical issue encountered when attempting to perform operations between directory service objects of different classes. Developers should carefully validate object types and ensure consistency in their operations to avoid this error.