Jun 23 2010

Testing MSMQ from Powershell

Category: zvolkov @ 16:01

Just a quick note to myself on how to ping a queue using PowerShell (note how verbose the syntax is!)

[Reflection.Assembly]::LoadWithPartialName( "System.Messaging" )
$msmq = [System.Messaging.MessageQueue]
$mq = New-Object $msmq("FormatName:DIRECT=OS:SERVERNAME\Private$\QUEUENAME", $False, $False, [System.Messaging.QueueAccessMode]::Peek);
$mq.Peek([System.TimeSpan]::FromSeconds(1))

Tags:

Comments

1.
Computer Lautsprecher Computer Lautsprecher says:

Hi im from germany and my english isnt that good, but i was able to translate every single sentence of your post. Im searching english websites to make my english better and im very happy to finally find a blog, which writes clear and structured english i´m able translate. Greetz from Germany!

Add comment


(Will show your Gravatar icon)

biuquote
  • Comment
  • Preview
Loading