SunQuest
 
       Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 4 - WMI Programming with Visual Basic.NET: Bre...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

WMI Programming with Visual Basic.NET: Breaking the Ice
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 14
    2005-06-21

    Table of Contents:
  • WMI Programming with Visual Basic.NET: Breaking the Ice
  • Our first program to connect to WMI (on a local computer)
  • Getting information from WMI
  • Our first program to connect to WMI (on a remote computer)

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
    IBM developerWorks
     
    ADVERTISEMENT

    Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!

    WMI Programming with Visual Basic.NET: Breaking the Ice - Our first program to connect to WMI (on a remote computer)


    (Page 4 of 4 )

    The previous sections introduced you to connecting only to a local computer, i.e. your own system. But what if I wanted to get the list of drives information for another computer (within the same network)? Is it as simple as changing the "ServerName" in the WMI path? Absolutely not.

    When we try to get the information from another computer, the concept of security comes in. To connect to another computer within the network, we need to provide the authentication information along with the WMI path! The following shows you the necessary modifications for the above program to connect to another computer:

    Dim options As New ConnectionOptions
    options.Username = "administrator"
    options.Password = ""
    Dim scope As New ManagementScope("\\hostname\root\cimv2", options)
      Dim diskClass As New ManagementClass(scope, New ManagementPath("Win32_LogicalDisk"), Nothing)

    Make sure you replace the "hostname" of the scope to the host name of the other computer within your network. So, the scope is now being provided with the necessary path, along with some connection options for username and password.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · nice article. just what i wanted
     

    VISUAL BASIC.NET ARTICLES

    - Movement and Player Statistics in a VB.NET T...
    - Creating and Drawing a Game Map in VB.NET
    - Working with Classes and Properties for Game...
    - Working with Loops, Arrays, and Collections ...
    - Learning Loops in VB.NET for Game Development
    - Learning VB.NET: Working with Variables, Con...
    - The Basics of VB.NET Through Text Game Devel...
    - Learning VB.NET Through Text Game Development
    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...
    - Shadowing using Shadows in Visual Basic.NET ...
    - Overloading and Overriding in Visual Basic.N...
    - More on Controlling Windows Fax Services Usi...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway