Jonathan Kalmes
2007-01-08 21:23:17 UTC
Hey all, I'm by no means a programmer, but I've been doing a bit of
poking around while writing some Powershell stuff for managing our
Exchange servers. I've found something that I keep tripping over when
it comes to WMI and Exchange queues...
In the Exchange system manager, I can check the queues on a server and
find that an offline server has 3 messages queued to go to it. But,
using WMI on that same queue, I find two different WMI/.Net objects for
the queue... one of which has two messages, the other has one. All
properties that I can find for these two WMI objects are the same, with
the exception of the QueueID, __RELPATH and __PATH values.
First, for the sake of my sanity, can anyone explain why Exchange and/or
WMI is doing this?
Second, it someone can give me a workaround for this or a better WMI
object to query against, that would make my scripts a whole lot easier
to deal with... as it is now, I'm going to have to put in a fair amount
of trapping and aggregating code to deal with this. I'm currently using
the following Powershell command to get at this data:
Get-wmiobject -class exchange_SMTPQueue -Namespace
ROOT\MicrosoftExchangev2 -ComputerName MYSERVER
Thanks in advance for any ideas on this... it's been bugging me for a while.
--Jonathan "smthng" Kalmes
http://smthng.info
poking around while writing some Powershell stuff for managing our
Exchange servers. I've found something that I keep tripping over when
it comes to WMI and Exchange queues...
In the Exchange system manager, I can check the queues on a server and
find that an offline server has 3 messages queued to go to it. But,
using WMI on that same queue, I find two different WMI/.Net objects for
the queue... one of which has two messages, the other has one. All
properties that I can find for these two WMI objects are the same, with
the exception of the QueueID, __RELPATH and __PATH values.
First, for the sake of my sanity, can anyone explain why Exchange and/or
WMI is doing this?
Second, it someone can give me a workaround for this or a better WMI
object to query against, that would make my scripts a whole lot easier
to deal with... as it is now, I'm going to have to put in a fair amount
of trapping and aggregating code to deal with this. I'm currently using
the following Powershell command to get at this data:
Get-wmiobject -class exchange_SMTPQueue -Namespace
ROOT\MicrosoftExchangev2 -ComputerName MYSERVER
Thanks in advance for any ideas on this... it's been bugging me for a while.
--Jonathan "smthng" Kalmes
http://smthng.info