RE: Data retrieval questions
- From: v-garych@xxxxxxxxxxxxxxxxxxxx (Gary Chang[MSFT])
- Date: Fri, 06 May 2005 08:33:34 GMT
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.
.
- Follow-Ups:
- RE: Data retrieval questions
- From: Matt
- Re: Data retrieval questions
- From: Torgeir Bakken \(MVP\)
- RE: Data retrieval questions
- References:
- Data retrieval questions
- From: Matt
- RE: Data retrieval questions
- From: Gary Chang[MSFT]
- RE: Data retrieval questions
- From: Matt
- Data retrieval questions
- Prev by Date: Re: Any way to make this code faster?
- Next by Date: Re: Data retrieval questions
- Previous by thread: RE: Data retrieval questions
- Next by thread: Re: Data retrieval questions
- Index(es):
Relevant Pages
|
Loading