title: How to set permissions on MSMQ Cluster queues?
body: <p>I've got a cluster with functioning private MSMQ 3.0 queues. I'm trying to programmatically set the permissions, but can't seem to connect via System.Messaging on the queues. The code below works just fine when working with local queues (and using .\ nomenclature for the local queue). How to programmatically set the permissions on the clustered queues? </p>
  
  <p>Powershell code executed from the active node </p>
  
  <pre><code>function set-msmqpermission ([string] $queuepath,[string] $account, [string] $accessright)
  {
      if (!([System.Messaging.MessageQueue]::Exists($queuepath))){
      throw "$queuepath could not be found."
  }
  $q=New-Object System.Messaging.MessageQueue($queuepath)
  $q.SetPermissions($account,[System.Messaging.MessageQueueAccessRights]::$accessright,            
    [System.Messaging.AccessControlEntryType]::Set)
  }
  set-msmqpermission "clusternetworkname\private$\qa1ack" "UserAccount" "FullControl"
  </code></pre>
  
  <p>Exception calling "SetPermissions" with "3" argument(s): "Invalid queue path name."
  At line:30 char:19
  +     $q.SetPermissions &lt;&lt;&lt;&lt; ($account,[System.Messaging.MessageQueueAccessRights]::$accessright,<br>
      + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
      + FullyQualifiedErrorId : DotNetMethodException</p>