How can I remove a user from Active Directory (AD) from the command line without using a script?

John Savill

October 2, 2003

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. Windows Server 2003's Dsrm command lets you remove objects from AD. The command syntax is

dsrm 

For example, to delete a user named piggy, you'd type

C:>dsrm CN=piggy,CN=Users,DC=it,DC=uk,DC=savilltech,DC=com

The computer will ask you to confirm the deletion:

Are you sure you wish to delete CN=piggy,CN=Users,DC=it,DC=uk,DC=savilltech,DC=com (Y/N)? y

If you answer "y", the computer will return the following response:

dsrm succeeded:CN=piggy,CN=Users,DC=it,DC=uk,DC=savilltech,DC=com

To avoid being prompted to confirm the deletion, you can append "-noprompt" (without the quotes) to the end of the command string.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like