Discussion:
Problems with LIKE clauses on WMI queries to MicrosoftExchangev2
(too old to reply)
Insider
2007-06-18 17:24:00 UTC
Permalink
I'm having trouble specifying a WHERE or LIKE clause on my WMI query to the
MicrosoftExchangev2 namespace.

This works OK
Select * From Exchange_Mailbox Where MailboxDisplayName='MyAlias'

This returns no data:
Select * From Exchange_Mailbox Where MailboxDisplayName LIKE 'My*'
neither does this:
Select * From Exchange_Mailbox Where MailboxDisplayName LIKE 'My%'
Other options fail too (LIKE '*Alia*', LIKE '%Alia%' etc etc etc)

I can use the LIKE clause on the root\CIMv2 namespace wihtout any problems.

Does the MicrosoftExchangev2 support the LIKE clause? Can anybody else get
it working, specifically with the Exchange_Mailbox class.

Regards,
Steven
Glen Scales [MVP]
2007-06-18 23:46:37 UTC
Permalink
I've never got this to work personally (always Error 80041024) there really
isn't that much information in that class to worry about eg you would
probably find the performance cost of doing a like query just as high as if
you pulled all the data back and filtered it at the client side.

Cheers
Glen
Post by Insider
I'm having trouble specifying a WHERE or LIKE clause on my WMI query to the
MicrosoftExchangev2 namespace.
This works OK
Select * From Exchange_Mailbox Where MailboxDisplayName='MyAlias'
Select * From Exchange_Mailbox Where MailboxDisplayName LIKE 'My*'
Select * From Exchange_Mailbox Where MailboxDisplayName LIKE 'My%'
Other options fail too (LIKE '*Alia*', LIKE '%Alia%' etc etc etc)
I can use the LIKE clause on the root\CIMv2 namespace wihtout any problems.
Does the MicrosoftExchangev2 support the LIKE clause? Can anybody else get
it working, specifically with the Exchange_Mailbox class.
Regards,
Steven
Loading...