RE: Data retrieval questions



Hi Matt,

> 1) How would I discover whether write caching is enabled on a
> physical disk via WMI?

Currently did not find an approach to retrieve this setting.


> 2) How would I retrieve the DNS root-hints configured on a DNS
> server (both as name strings and IP addresses)?

The following script will return information about the root hints stored in
the cache file on a DNS server:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & _
"\root\MicrosoftDNS")

Set colItems = objWMIService.ExecQuery _
("Select * from MicrosoftDNS_RootHints")

For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Container Name: " & objItem.ContainerName
Wscript.Echo "DNS Server Name: " & objItem.DnsServerName
Wscript.Echo
Next


> 3) How would I retrieve information from WMI that reflects the
information
> returned by invoking "ipconfig /displaydns" on the command line?

Currently did not find an approach to retrieve this setting.


> 4) How would I retrieve the binding order of NICs on a given machine?

I suggest you look into the Win32_PerfFormattedData_Tcpip_NetworkInterface
class which is available on Windows 2003 and XP:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/
win32_perfformatteddata_tcpip_networkinterface.asp

And the following script will enumerate the local machine's NICs in a
descendant order:

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_PerfFormattedData_Tcpip_NetworkInterface",,48)
For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Next


> 5) Is there a way to query a particular event log for a count of event
> entries that match a criteria (e.g. source name = "MyService" and
> Event Id = "2345")?

You can manually calculate it with a WQL query:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where SourceName = 'MyService'" And
EventIdentifier = '2345')

Dim iCount
iCount = 0
For Each objEvent in colLoggedEvents
iCount = iCount+1
Next

WScript.echo iCount


> 6) How would I be able to determine that the information store on
> an Exchange server was receiving email messages that contain
> deep-nested notification messages?

This problem appears to be an Exchange server specific one, for I am not
familiar about the stuff of Exchange server, I think it is better for you
to post this question in the microsoft.public.exchanger2000.admin
newsgroup, and you may receive more expertise opinions there.


Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • RE: Data retrieval questions
    ... On question #6, I know its related to Exchange, ... but I'm looking for a WMI solution. ... >> 2) How would I retrieve the DNS root-hints configured on a DNS ... > This problem appears to be an Exchange server specific one, ...
    (microsoft.public.win32.programmer.wmi)
  • not able to get Exchange info (MAPI C++) through local Administrator account but able to get the sam
    ... types on Exchange server test machines ... nd setup: Two different hosts (one for PDC and other for exchagne ... Code is able to retrieve all exchange server info for 1st setup with ... But problem is for 2nd setup when I login as a local Administrator to ...
    (microsoft.public.exchange.applications)
  • Re: Retrieving a sent email before recepient opens it
    ... Unless you are using an Exchange server, there is no message recall. ... the best way to retrieve ... the (insert latest virus name here) virus, all mail sent to my personal ...
    (microsoft.public.outlook)
  • Mobile phone and exchange 2003
    ... An employee is using office online with his cell phone to retrieve his ... Phone uses MAPI client to connect to exchange server, ... Any idea why how and why exchange gives or allows all calendar events to be ...
    (microsoft.public.exchange.admin)
  • Inconsistency in retrieving freeBusy Information from Exchange Server
    ... We are trying to retrieve the freeBusy information from Exchange Server ... There is a cluster of exchange server with users spread across the ...
    (microsoft.public.exchange2000.development)

Loading