Problem solve Get help with specific problems with your technologies, process and projects.

AQADMCLI: Command-line SMTP queue management for Exchange Server

AQADMCLI is a command-line tool for Exchange Server that can quickly clear up a choked SMTP queue. It used to only be available to customers through Microsoft Product Support Services. Now it's freely available to anyone.

Every Exchange Server administrator will eventually have to deal with an SMTP queue that's choked with messages.

Sometimes an SMTP queue can be flooded by thousands of non-delivery reports (NDRs) due to spam; and sometimes it can be caused by undeliverable email that has been mistakenly auto-generated.

Clearing the SMTP queue usually involves deleting the files in the queue directory through Windows Explorer or a del *.* command -- but these aren't the only ways to handle the problem.

One way that works directly with Exchange Server instead of through the file system is a command-line utility called AQADMCLI. It sounds like a Roman numeral, but it's actually a tool that Microsoft used to only make available for Exchange Server customers through calls to Product Support Services. contributor Brien M. Posey mentioned AQADMCLI a couple of years ago in his tip, "Stay above the SMTP queue floods". But back then, it was only available as a PSS support-call utility. Now it is freely available for download from Microsoft's FTP site.

To empty out an SMTP queue using AQADMCLI, run it from the command line and type in the following commands:

setserver <servername>
delmsg flags=all

<servername> is, of course, the name of the Exchange server containing the queue you want to manage.

If you want to delete messages by specific criteria instead of just dumping everything, the delmsg command can be given specific flags (as the above syntax implies).

For instance, if you type delmsg flags=SENDER,, all messages sent by will be flagged for deletion.

Run AQADMCLI HELP and you'll get a complete dump of all the available commands and their syntax.

About the author: Serdar Yegulalp is editor of the Windows Power Users Newsletter.

Do you have comments on this tip? Let us know.

Related information from

  • Tip: Deleting auto-generated spam from the outbound queue
  • Tip: Disk performance best practices for MTA and SMTP queues
  • Tip: SMTP service tuning
  • Tip: Excessive Exchange Server NDRs destroy DNS
  • Learning Guide: How to fight spam on Exchange Server
  • Reference Center: SMTP tips and resources

    Please let others know how useful this tip was via the rating scale below. Do you have a useful Exchange Server or Microsoft Outlook tip, timesaver or workaround to share? Submit it to If we publish it, we'll send you a nifty thank-you gift.

  • Dig Deeper on Exchange Server setup and troubleshooting

    Join the conversation

    1 comment

    Send me notifications when other members comment.

    Please create a username to comment.

    I’m not ordinarily this dense, but I can’t figure out how to turn this into a batch file I can schedule.
    I want to delete messages with no sender, and delete messages from
    If I type the commands in one at a time everything works.
    What am I missing?