Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
Available now!
Buy at Amazon US or
Buy at Amazon UK



Articles

1.Windows API reference
2.HTML to WML Converter
3.Webcam streaming in VB.NET
4.Remoting with firewalls
5.RSA from first principles
6.Key & MouseLogger in .NET
7.Networking Resource Kit for .NET
8.Automatic Reboot with .NET
9.XAML Schema
10.Migrating VB6 Winsock to VB.NET
11.Migrating C++ sockets to C#
12.RFC Reference guide
13.Lingua - Localization webservice
14.COM Reference guide
15.WMI Reference guide
16.SQL stored procedures
17.TCP & UDP port reference
18..NET Framework reference
19.Ethernet Type codes
20.IP to country webservice
21.MAC address assignments
22.DLL entry point reference
23.WHOIS server list
24. Turing Numbers
25. Boost SQL performance
26. Progress Bar in ASP.NET
27. OleDb WebService
27. Internet Explorer

Contact us

9.0 WMI query analyser, in C# and VB.NET

Windows Management Instrumentation, (WMI) is a common object model for a host of technical information about a systems hardware and software configuration. It can be used to query either a local machine, or if permissions allow, a remote computer. This technology can be used to enumerate and detail any of the following aspects of the operating system:

  • List, start, stop and suspend services
  • List, Start (spawn) and stop processes
  • Read the NT event log
  • Enumerate Hard-drives, CD-Rom drives, Partitions etc.
  • Read computer operating specifics (CPU speed, memory  etc.)
  • Read BIOS settings
  • Get Network adapter-specific information, such as MAC addresses.
  • Query WDM (Windows Driver Model) devices, such as Web-cameras
  • Read & write to remote Windows registries
  • Query the Active Directory

Although each of the above actions may be performed using low-level windows API calls, or in certain other cases, other classes within .NET. However WMI provides a simple all-encompassing namespace/class object model, putting this wealth of information at your fingertips. Furthermore, it gives the ability to perform all of these actions remotely, without the need for a custom-built server application.

To give an example, imagine you wanted to develop a system to automatically deploy software patches on an enterprise-wide basis. In order to get each computer to accept, and execute these patches, you would need to develop a service that could listen for requests to execute these executables, build some form of authentication mechanism for security, then deploy this service to all computers on the network. Alternatively, if you used WMI, you could use one central computer to send WMI requests to all the computers on your network to install the patch, et viola, no need for the deployment of a custom server.

WMI is a huge subject, so therefore it is practically impossible to provide a comprehensive example program that covers anything. However, this application can be used to make WQL (WMI query language) on the root\cimv2 namespace of the CIM (Common Information Model). The book Network programming in .NET (Buy at Amazon UK) (Buy at Amazon US) covers a much wider scope of WMI, and explains how to leverage it to access the bounty of information held within this vast, yet simple object model.

To use this application, type in the name of a remote computer (or localhost) into the space provided. If you require different account privileges, then you must also provide the NT username and password for this computer in the spaces provided. You may then type a WQL query into the ‘Query’ box, and press ‘Execute’. In the example below, we have used “select * from Win32_NetworkAdapterConfiguration” (see screenshot below)

(Source code availabile in the book Network Programming in .NET (Buy at Amazon UK) (Buy at Amazon US), Chapter 12, example 4)

Page 2  Page 3  Page 4  Page 5  Page 6  Page 7  Page 8  Page 9  Page 10  Page 11  Page 12  Page 13 



Google

Free SMS UK Free SMS Ireland SMS Gratis Norway SMS Gratis Sverige Ilmainen SMS Suomi SMS Gratis Danmark SMS Tasuta Eestisse SMS Nemokamai Lietuva SMS Bezmaksas Latviju Darmowe smsy Polska SMS Zdarma Ceské SMS Zdarma Slovensko SMS Gratis Deutschland SMS Gratis Schweiz SMS Gratis Österreich SMS Gratuit Belgique SMS Gratis Nederland SMS Gratuit France SMS Gratis España SMS Gratis Portugal Free SMS South Africa Free SMS USA SMS Percuma Malaysia Free SMS Hong Kong