Support all versions
WMI is a powerful technology: simply specifying a WMI class name can return all instances of its class:
Copy Code code as follows:
Ps> Get-wmiobject-class Win32_BIOS
Smbiosbiosversion:76cn27wwManufacturer:lenovoName:76cn27wwserialnumber:1006250300406Version:lenovo-1
How do you know which classes it has? Here's a search tool:
Copy Code code as follow
The concept of collections is common in Windows scripts, especially in WMI-related scripts, where collection operations are generally encountered.
The way to iterate through the collection in VBScript is simple, for Each loop can achieve the purpose. However, in JScript
How to use the collection, but it bothered me for a long time, even the MSDN can not find good examples, so I was once pessimistic that
JScript cannot perform collection operations.
W
1. Introduction
In WMI, you can obtain information about a disk drive by using the Win32_DiskDrive object:
ManagementClass mc = new ManagementClass ("win32_diskdrive");Managementobjectcollection MOC = MC. GetInstances ();foreach (ManagementObject mo in MOC){PropertyInfo = mo. Properties[propertyname]. Value.tostring ();}
2, property name
The property name of the Win32_DiskDrive object is as follows:
AvailabilityBytesPerSectorCapabilitiesCapabilitydes
Copy Code code as follows:
IP = "Jb51.net"
WQL = "SELECT * from win32_pingstatus Where address = ' $IP '"
WQL = Replace (WQL, "$IP", IP)
n = 0:s = 0
Do Until n = 100
Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2")
Set colitems = objWMIService.ExecQuery (wql,,48)
For each objitem in colitems
If objitem.statuscode = 0 Then
s = s + objitem.responsetime
n = n + 1
End If
Next
Loop
WScript.Echo "Average:" s/n
Reference Links: Win32_PingStatus ClassOriginal: http://de
Today, the server reinstall MSSQL2005 version, in order to secure the mssql2005 run under the Independent user, permissions are not wrong, but unexpectedly the following error occurred;
---------------------------
WMI Provider Error
---------------------------
Warning: You also have time to log out of%1, and if you do not log off after this time, your session will be disconnected and any open files or devices may lose data. [0X80070D59]
------------
If you are administrate a Web server on a remote machine, then your know how important it can is able to quickly view R Event logs and ' check on things ' Until recently, the only way to did this is to log onto the machine via Terminal Servic ES, VNC or PC Anywhere, log onto the desktop, and bring up Event viewer that way. Or, you could use somebody ' s component.
Fortunately,. The Windows Management Instrumentation (WMI) interface has become so soph
First, let's take a look at the structure of the Query Class in WMI. Net:
The basic class is system. Management. managementquery, which represents the abstract management Query type and inherits icloneable. Managementquery is an abstract class. It has two important attributes: querylanguage and querystring (both string types), representing the query language and query string respectively. Although the managementquery type is an abstract class,
C # The content for WMI operations is encapsulated in system. Management. dll. The details are described in msdn. By default, ["** '] is used to read and set properties.
This section describes how to automatically generate a strongly typed packaging software, which is much easier to handle and does not need to repeatedly view parameters and other information.
1. Use wmiexplorer to generate the packaging class corresponding to
ctionWin32_servicecontrolWin32_servicespecificationWin32_servicespecificationserviceWin32_settingcheckWin32_shortcutactionWin32_shortcutsapWin32_softwareelementWin32_softwareelementactionWin32_softwareelementcheckWin32_softwareelementconditionWin32_softwareelementresourceWin32_softwarefeatureWin32_softwarefeatureactionWin32_softwarefeaturecheckWin32_softwarefeatureparentWin32_softwarefeaturesoftwareelementsWin32_typelibraryaction )}WMI Service Managem
Python is powerful, but invoking WMI is more "authentic" than using VBS.
Copy Code code as follows:
On Error Resume Next
StrComputer = "."
Set objWMIService = GetObject ("winmgmts:\\" StrComputer "\root\cimv2")
Set colitems = objWMIService.ExecQuery ("SELECT * from Win32_Processor", 48)
For each objitem in colitems
WScript.Echo "Loadpercentage:" Objitem.loadpercentage
Next
Reference Links: win32_processor Class
Origi
Copy Code code as follows:
StrComputer = "."
Set objWMIService = GetObject ("winmgmts:" _
"{impersonationlevel=impersonate}!\\" _
StrComputer "\root\cimv2")
Set colfiles = objWMIService. _
ExecQuery ("select * from cim_datafile where Extension = ' mp3 '")
For each objfile in Colfiles
WScript.Echo Objfile.name
Next
The top
ExecQuery ("select * from cim_datafile where Extension = ' mp3 '")
You can search for other files by replacing the MP3 in one line with another.
Referenc
1. Introduction
In WMI, you can obtain information about a disk drive by using the Win32_Processor object:
ManagementClass mc = new ManagementClass ("Win32_memorydevice");
Managementobjectcollection MOC = MC. GetInstances ();
foreach (ManagementObject mo in MOC)
{
PropertyInfo = mo. Properties[propertyname]. Value.tostring ();
}
2, Properties
The properties of the Win32_memorydevice object in WMI are as
Introduced
This is another new book on Windows Management Instrumentation (Windows Management specification) after my last article, "My Explorer." I'm going to show you some techniques that allow you to remotely access the operating systems, services, and currently running processes of other computers on your network, if you have to have administrator privileges on those computers. I will also show you how to use WMI to start or stop a service, termi
DefinedWMI (Windows Management instrumentation,windows Management specification) is a core Windows management technology that allows users to manage both local and remote computers using WMI.Common WMI ViewWMI ReferenceWMI ClassesComputer System Hardware Classes Win32_Printer Win32_PrintJobWin32 ClassesWMI ProvidersC # exampleusing System.Management;Stringquery =string. Format ("SELECT * from win32_printer WHERE Name = ' {0} '", PrinterName); Man
Solution 1 found on the internet is feasible.
Open [SQL Server Configuration Manager] and prompt: Unable to connect to WMIProgram. You do not have permission or the server cannot be accessed. Note that you can only use the SQL Server Configuration Manager to manage SQL Server 2005 servers. ---------------------------SQL Server Configuration Manager---------------------------Cannot connect to the WMI provider. You do not have permission or the ser
In the ApplicationProgramFor Hostnamememory
Affinity provider Configuration WMI
Service
Overview
InArrv1, Provides2Host Name affinity programs:
1.Microsoft. Web. Arr. hostnameroundrobin
2.Microsoft. Web. Arr. hostnamememory
Microsoft. Web. Arr. hostnameroundrobinThe provider does not depend on the application server. When using this provider,ArrIt's just a simple assignment of host names.
However,Microsoft. Web. Arr. hostnamememo
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.