WMI Scripting First Experience

Source: Internet
Author: User

1. Introduction

WMI is an administrative support technology for Windows, and WMI was originally released as an add-on in 1998 with Windows NT 4.0 Service Pack 41, which is built into Windows 2000, Windows XP, and Windows Serve The core management support technology in the R 2003 series operating system.

WMI is a specification and infrastructure through which you can access, configure, manage, and monitor all-almost all Windows resources.

2.WMI Script Programming first experience

Let's look at an example: retrieving total physical memory using WMI and VBScript

'//'. " represents the native
Const def_strcomputer = "."

'//in anyWMIscript, the first step is to create aWindowsa connection to a management service, such as:'//set wbemservices = GetObject ("winmgmts:\\Computer name")Set wbemservices = Getobject("winmgmts:\\.")Set wbemobjectset = wbemservices. InstancesOf ("Win32_LogicalMemoryConfiguration") forEach wbemobject in wbemobjectset WScript. Echo "Physical Memory: " & CInt(wbemobject. TotalPhysicalMemory / 1024x768) & "M bytes. "NextDownload Tools for 3.WMI development

WMI Administrative Tools (WMI CIM studio,wmi Object Browser) Download:
http://www.microsoft.com/downloads/details.aspx?familyid=6430F853-1120-48DB-8CC5-F2ABDC3ED314&displaylang= En

4. References

Getting Started with WMI scripting: part http://msdn.microsoft.com/zh-cn/library/ms974579.aspx
Getting Started with WMI scripting: Part Two http://msdn.microsoft.com/zh-cn/library/ms974592.aspx
Getting Started with WMI scripting: Part III http://msdn.microsoft.com/zh-cn/library/ms974547.aspx
Using wmi:http://msdn.microsoft.com/en-us/library/aa393964.aspx
Scripting API for wmi:http://msdn.microsoft.com/en-us/library/aa393258 (vs.85). aspx

WMI Scripting First Experience

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.