Microsoft KB Archive/242471

= FILE: MSMQ Local Admin API =

Article ID: 242471

Article Last Modified on 10/26/2007

-

APPLIES TO


 * Microsoft Message Queue Server 1.0

-



This article was previously published under Q242471



SUMMARY
Msmqadm.exe is a self-extracting file that contains the documentation and additional files to use the Microsoft Message Queue Local Admin API functionality that is exposed by MSMQ on Windows NT Service Pack 4 and Windows 2000.

The documentation describes a set of functions (MQMgmtGetInfo, MQMgmtAction and MQPurgeQueue) and one flag (MQ_ADMIN_ACCESS) that expose a variety of internal MSMQ information, and provides administrative tasks on the Message Queuing service of a specified computer (either the local computer or a specified remote computer).



MORE INFORMATION
The following file is available for download from the Microsoft Download Center:

Msmqadm.exe

Release Date: Oct. 10, 2003

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

The following are examples of what these APIs and flags enable:
 * Listing of the private queues of a computer. Private queues are not published in the Directory Service (DS), so this API is the only way to list them.
 * Listing of the outgoing queues of a computer. These are the internal queues, created on the fly by MSMQ, to hold messages destined for remote queues. For example, when sending messages to a remote queue machine1\queueA, you would see an internal outgoing queue named "machine1\queueA" on the sending computer.
 * Obtaining a variety of internal information about a specific queue, such as how many messages in an outgoing transactional queue are still un-Acked.
 * Reading the messages in a specific outgoing queue. For example, when sending messages to a remote queue while the sending computer is offline, it is possible to Peek all messages sent to that remote queue as they accumulate in the corresponding outgoing queue (waiting to be sent) and delete specific messages.
 * Stopping/resuming delivery from a specified outgoing queue. This may be helpful in situations where the target computer can't cope with new messages, or to allow a type of deferred delivery mechanism controlled programmatically.
 * Stopping/resuming an entire computer from sending or accepting any messages from the network.
 * Purging all messages in a queue (private, public, or outgoing queue). This is much more efficient than deleting messages one-by-one.

Note that most of the local admin APIs are exercised by the MSMQ 2.0/Windows 2000 Microsoft Management Console (MMC) snap-in extension to the Computer Management MMC snap-in.

Building applications using this API requires the following:
 * 1) Inclusion of "MQMGMT.H" in the application's source file.
 * 2) Linking your application:
 * 3) * Windows NT 4.0: the MSMQ 1.0 run-time library (Mqrt.lib) as released in Windows NT 4.0 Server Enterprise Edition or the Windows NT 4.0 Option Pack does not expose the local admin APIs. To successfully link applications using this API, use Mqrt.lib, which is included with the files in the self-extracting exe.
 * 4) * Windows 2000: the local admin API is already part of Mqrt.lib for Windows 2000 as provided in the Windows 2000 Platform SDK.
 * 5) Running your application:
 * 6) * Windows NT 4.0: the local admin API is supported on Windows NT 4.0 only if Service Pack 4 (or later) is applied.
 * 7) * Windows 2000: Any Windows 2000 build is appropriate.
 * 8) Note that the MQMgmtAction and MQPurgeQueue API require local administrator's privileges.

Additional query words: MSMQ Msmqadm Local admin api purge private queue

Keywords: kbproductlink kbdownload kbfile KB242471

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.