Re: Order By in Query



Barry wrote:

Hi

    does any know if ORDER BY can be used in the following query
of WMI for Exchange

hr = m_pServices->ExecQuery(bstrQueryLang, L"Select * From Exchange_Mailbox Order By MailboxDisplayName",
WBEM_FLAG_FORWARD_ONLY, 0, &pEnum);


I get an error for the above query
Hi,

No, WQL does not support "ORDER BY"...



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
.



Relevant Pages

  • Re: security center
    ... but you can query the PC's via WMI (Windows Management Instrumentation) scripting. ... The below script is for the local computer, and would need to be modified to determine all PC's on your network/domain and then query each computer individually and report when there is a problem. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: WMI & ADSI
    ... > WMI to query the domain role of each computer object. ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Sort results from ExchangeV2
    ... the mailbox. ... I can get the query to return only mailboxes larger than the set size, but if I request the collection sorted it becomes empty. ... SQL for WMI ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter/default.mspx. ...
    (microsoft.public.scripting.vbscript)
  • Re: WMI Problem
    ... So while I am banging my head on WMI, ... > there a way to query the domain for all machines currently logged on, ... > better yet all machines whose names start with 'WKS_' that arelogged on? ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.wsh)
  • Re: ExecQuery hangs whole script but GetObject is fine
    ... problems/errors with XP SP2 if using WMI. ... How to troubleshoot WMI-related issues in Windows XP SP2 ... > executing the query and the query hangs and thus the whole script ... > of the DCs as a domain admin but in the scheduled task that the script ...
    (microsoft.public.win32.programmer.wmi)