The dsrm CMD command is a command line prompt used to delete objects from the Active Directory domain. It is part of the Windows Server operating system and is used to delete objects such as users, groups, computers, and organizational units. The dsrm command is also used to delete objects from the command line, which is useful for scripting and automation. In this article, we will discuss the syntax, options, and user examples of the dsrm CMD command.

Syntax of the dsrm CMD Command

The syntax of the dsrm CMD command is as follows:

dsrm [Object] [-noprompt] [-subtree] [-confirm] [-c] [-q] [-s] [-u] [-p] [-g] [-r] [-l] [-a] [-f]

Where:

  • Object – The object to be deleted.
  • -noprompt – Suppresses the prompt for confirmation.
  • -subtree – Deletes the object and all its descendants.
  • -confirm – Prompts for confirmation before deleting the object.
  • -c – Deletes the object and all its child objects.
  • -q – Suppresses the display of success messages.
  • -s – Deletes the object and all its child objects, including those that are hidden.
  • -u – Deletes the object and all its child objects, including those that are not visible in the Active Directory Users and Computers console.
  • -p – Deletes the object and all its child objects, including those that are protected from accidental deletion.
  • -g – Deletes the object and all its child objects, including those that are protected from accidental deletion.
  • -r – Deletes the object and all its child objects, including those that are protected from accidental deletion.
  • -l – Deletes the object and all its child objects, including those that are protected from accidental deletion.
  • -a – Deletes the object and all its child objects, including those that are protected from accidental deletion.
  • -f – Forces the deletion of the object, even if it is protected from accidental deletion.

Options of the dsrm CMD Command

The dsrm CMD command has several options that can be used to modify the behavior of the command. These options are as follows:

  • -noprompt – Suppresses the prompt for confirmation.
  • -subtree – Deletes the object and all its descendants.
  • -confirm – Prompts for confirmation before deleting the object.
  • -c – Deletes the object and all its child objects.
  • -q – Suppresses the display of success messages.
  • -s – Deletes the object and all its child objects, including those that are hidden.
  • -u – Deletes the object and all its child objects, including those that are not visible in the Active Directory Users and Computers console.
  • -p – Deletes the object and all its child objects, including those that are protected from accidental deletion.
  • -g – Deletes the object and all its child objects, including those that are protected from accidental deletion.
  • -r – Deletes the object and all its child objects, including those that are protected from accidental deletion.
  • -l – Deletes the object and all its child objects, including those that are protected from accidental deletion.
  • -a – Deletes the object and all its child objects, including those that are protected from accidental deletion.
  • -f – Forces the deletion of the object, even if it is protected from accidental deletion.

User Examples of the dsrm CMD Command

The dsrm CMD command can be used in a variety of ways. Here are some examples of how it can be used:

  • To delete a user: dsrm user1 -noprompt
  • To delete a group: dsrm group1 -noprompt
  • To delete a computer: dsrm computer1 -noprompt
  • To delete an organizational unit: dsrm ou=ou1 -noprompt
  • To delete an object and all its descendants: dsrm ou=ou1 -subtree -noprompt
  • To delete an object and all its child objects: dsrm ou=ou1 -c -noprompt
  • To delete an object and all its child objects, including those that are hidden: dsrm ou=ou1 -s -noprompt
  • To delete an object and all its child objects, including those that are not visible in the Active Directory Users and Computers console: dsrm ou=ou1 -u -noprompt
  • To delete an object and all its child objects, including those that are protected from accidental deletion: dsrm ou=ou1 -p -noprompt
  • To delete an object and all its child objects, including those that are protected from accidental deletion: dsrm ou=ou1 -g -noprompt
  • To delete an object and all its child objects, including those that are protected from accidental deletion: dsrm ou=ou1 -r -noprompt
  • To delete an object and all its child objects, including those that are protected from accidental deletion: dsrm ou=ou1 -l -noprompt
  • To delete an object and all its child objects, including those that are protected from accidental deletion: dsrm ou=ou1 -a -noprompt
  • To force the deletion of an object, even if it is protected from accidental deletion: dsrm ou=ou1 -f -noprompt

Conclusion

The dsrm CMD command is a powerful command line prompt used to delete objects from the Active Directory domain. It has several options that can be used to modify the behavior of the command. In this article, we discussed the syntax, options, and user examples of the dsrm CMD command.

Leave a Reply