Windows Dev Center


The MQSetQueueProperties function sets the properties of a specific queue.

  LPCWSTR lpwcsFormatName,  
  MQQUEUEPROPS * pQueueProps  



[in] Pointer to the format name string of the queue whose properties will be set. A public or private format name can be used to specify the queue. You can only use a direct format name to set the properties of a local private queue.


[in] Pointer to the MQQUEUEPROPS structure that specifies the properties to be set.

On input, the cProp member of MQQUEUEPROPS specifies the number of properties to be set, the aPropID array specifies their property identifiers, and the aPropVar array indicates the new values of the specified properties.

On output, the optional aStatus array, if it was included in MQQUEUEPROPS, indicates the status of the properties.

Return Values


Indicates success.


The access rights for setting the properties of the queue are not allowed for the calling process. For a complete list of queue access rights, see Access Control.

To change the access rights of the queue, call MQSetQueueSecurity.


The lpwcsFormatName parameter specified an illegal format name.


An illegal property value is specified.


One of the IN parameters supplied by the operation is not valid.

MQ_ERROR_NO_DS (0xC00E0013)

A connection with the directory service cannot be established. Verify permissions for accessing the directory service.


One or more properties resulted in an error.


The Message Queuing service is not available.


The format name specified by the lpwcsFormatName parameter cannot be used. You cannot reference a public queue or a remote private queue in a call to this function using a direct format name, nor can you set the queue properties of a journal, dead-letter, or connector queue.


The properties for the queue cannot be set in the MSMQ Information Store (MQIS) because a new MQIS server is being installed.


One or more of the properties resulted in a warning even though the function completed.

Apart from generic Message Queuing error codes, this function may return ADSI and LDAP error codes. For example, LDAP_BUSY (0x8007200E) is returned when the directory service server is busy.


The following queue properties cannot be set by MQSetQueueProperties.

Property Name Reason


For public queues only. Cannot be set for private queues.


Set by Message Queuing.


Set by Message Queuing.


Set by Message Queuing.


Can only be set when the queue is created.


Can only be set when the queue is created.

When setting the properties of a public queue, some clients may still see the old settings registered in the directory service after the properties have been changed. Changes to the directory service (such as setting properties) are replicated from domain controller to domain controller, which can cause delays in the availability of new information. Consequently, clients using a specific domain controller may still see the old property settings, even though the settings of the properties were changed by MQSetQueueProperties. Replication delays, including communication network delays such as down links, are controlled by the Message Queuing administrator.

A public queue's properties cannot be set if there is no connection to the directory service. This restriction applies to dependent client computers, independent client computers that are working offline, and Message Queuing routing servers (FRS).

Equivalent COM Method

When using COM components, you can set the properties of a queue by setting the properties of an MSMQQueueInfo object that has been initialized to represent the queue and then calling the Update method of the same object.

For information on See

A complete list of queue properties

Message Queuing Properties

Obtaining a format name for opening a queue

Obtaining Format Names

Offline operations

Message Queuing Offline Support

Example Code

The following code examples are included in Using Message Queuing.

For an example of See

Setting the authentication level

C/C++ Code Example: Setting PROPID_Q_AUTHENTICATE

Setting the base priority level

C/C++ Code Example: Setting PROPID_Q_BASEPRIORITY

Setting the journaling level and the maximum size of the queue journal

C/C++ Code Example: Setting PROPID_Q_JOURNAL

C/C++ Code Example: Setting PROPID_Q_JOURNAL_QUOTA

Setting the queue label

C/C++ Code Example: Setting PROPID_Q_LABEL

Setting the multicast address associated with the queue


Setting the privacy level of the queue

C/C++ Code Example: Setting PROPID_Q_PRIV_LEVEL

Setting the maximum size of the queue

C/C++ Code Example: Setting PROPID_Q_QUOTA

Setting the queue type

C/C++ Code Example: Setting PROPID_Q_TYPE


Windows NT/2000/XP: Included in Windows NT 4.0 SP3 and later.

Windows 95/98/Me: Included in Windows 95 and later.

Header: Declared in Mq.h.

Library: Use Mqrt.lib.

See Also

© 2015 Microsoft