Visual Basic.NET
  Home arrow Visual Basic.NET arrow Listing/Modifying Server Information with ...
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 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
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

Listing/Modifying Server Information with Visual Basic.NET and VBScript Using WMI
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2005-12-13

    Table of Contents:
  • Listing/Modifying Server Information with Visual Basic.NET and VBScript Using WMI
  • Listing minimum server information using WMI
  • How to retrieve all user account information using WMI
  • How to retrieve all group information along with account information using WMI
  • How to change your computer name using WMI

  • 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
     
     
     
    ADVERTISEMENT

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Listing/Modifying Server Information with Visual Basic.NET and VBScript Using WMI
    (Page 1 of 5 )

    This article explains how you can retrieve Windows server information using both Visual Basic.NET and VBScript, along with WMI.
    A downloadable file for this article is available here.

    The sample downloadable solution (zip) is entirely developed using Visual Studio.NET 2003 Enterprise Architect on Windows Server 2003 Standard Edition.  But, I am confident that it would work with other versions of Windows (which support .NET 1.1) versions as well.

    Some global routines used for my WMI development

    Let me first address some issues.  I received a lot of feedback from several readers throughout the world on my series “WMI Programming with Visual Basic.NET”.  Almost every one (about 80%) requested that I extend the series with much more useful and helpful information about working with WMI (in the form of tasks).  Some of the readers also asked me to give examples on VBScript as well (and not only VB.NET).

    One should consider that WMI is being updated and enhanced almost every day.  Microsoft is also integrating WMI directly into some of its products. With humble thanks to every reader who encouraged me to write more, I further extend the same series (but with a different naming scheme). I will be including much more useful information, both for developers and system administrators. 

    I keep on extending the same series as much as possible, covering almost all the aspects of WMI.  I strongly suggest you go through my series on “WMI Programming with Visual Basic.NET” before reading this article.  The series even covers “event handling” using WMI with Visual Basic .NET in the form of Windows Service.

    For flexibility in retrieving WMI information (using VB.NET), I frequently used the following simple global routines which would help me to work with other areas of development very easily.

    Public Sub addRow(ByRef dt As DataTable, ByVal p As String, ByVal v As String)
            Dim dr As DataRow
            dr = dt.NewRow
            dr("Property") = p
            dr("Value") = v
            dt.Rows.Add(dr)
        End Sub
    Public Function getStructure() As DataTable
            Dim dt As New DataTable
            dt.Columns.Add(New DataColumn("Property"))
            dt.Columns.Add(New DataColumn("Value"))
            Return dt
        End Function

    Two of my global routines are “getStructure” and “addRow”.  Both are generally used if I have the “Property->value” scenario. “GetStructure” just creates a data table structure and “AddRow” just adds a data row for every data table passed to it.  And similarly, I also have the following two, to work with “UserAccountInformation”.

    Public Function getUserAccountStructure() As DataTable
            Dim dt As New DataTable
            dt.Columns.Add(New DataColumn("FullName"))
            dt.Columns.Add(New DataColumn("Name"))
            dt.Columns.Add(New DataColumn("Domain"))
            dt.Columns.Add(New DataColumn("LocalAccount"))
            Return dt
        End Function
        Public Sub addUserAccountRow(ByRef dt As DataTable, ByVal FullName As String, ByVal Name As String, ByVal Domain As String, ByVal LocalAccount As String)
            Dim dr As DataRow
            dr = dt.NewRow
            dr("FullName") = FullName
            dr("Name") = Name
            dr("Domain") = Domain
            dr("LocalAccount") = LocalAccount
            dt.Rows.Add(dr)
        End Sub

    More Visual Basic.NET Articles
    More By Jagadish Chaterjee


       · I hope you enjoyed this article on how to retrieve information from your server....
     

    VISUAL BASIC.NET ARTICLES

    - 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...
    - Programmatically Controlling Windows Fax Ser...
    - Focusing on Forms and Menus in Visual Basic
    - Manipulating Forms with the Windows Forms Li...
    - Basics of the Windows Forms Library
    - Forms, Controls, and Other Useful Objects
    - Implementing OOP to Develop Database Oriente...
    - Using Themes and Skins for Personalization w...
    - A Deeper Look at Personalization using Visua...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




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