WMI 数据读取器任务WMI Data Reader Task

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是 Azure 数据工厂中的 SSIS Integration RuntimeSSIS Integration Runtime in Azure Data Factoryyes Azure 数据工厂中的 SSIS Integration RuntimeSSIS Integration Runtime in Azure Data Factory适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是 Azure 数据工厂中的 SSIS Integration RuntimeSSIS Integration Runtime in Azure Data Factoryyes Azure 数据工厂中的 SSIS Integration RuntimeSSIS Integration Runtime in Azure Data Factory

WMI 数据读取器任务使用 Windows Management Instrumentation (WMI) 查询语言来运行查询,此查询语言从 WMI 返回有关计算机系统的信息。The WMI Data Reader task runs queries using the Windows Management Instrumentation (WMI) Query Language that returns information from WMI about a computer system. 可以将 WMI 数据读取器任务用于下列目的:You can use the WMI Data Reader task for the following purposes:

  • 查询本地或远程计算机上的 Windows 事件日志并将此信息写入文件或变量。Query the Windows event logs on a local or remote computer and write the information to a file or variable.

  • 获取有关硬件组件的存在、状态或属性的信息,然后使用此信息决定控制流中的其他任务是否应该运行。Obtain information about the presence, state, or properties of hardware components, and then use this information to determine whether other tasks in the control flow should run.

  • 获取应用程序的列表,并确定每个应用程序安装的是何种版本。Get a list of applications and determine what version of each application is installed.

可以通过以下方式配置 WMI 数据读取器任务:You can configure the WMI Data Reader task in the following ways:

  • 指定要使用的 WMI 连接管理器。Specify the WMI connection manager to use.

  • 指定 WQL 查询的源。Specify the source of the WQL query. 查询可以存储在任务属性中,也可以存储在任务之外的变量或文件中。The query can be stored in a task property, or the query can be stored outside the task, in a variable or a file.

  • 定义 WQL 查询结果的格式。Define the format of the WQL query results. 该任务支持表、属性名称/值对或属性值三种格式。The task supports a table, property name/value pair, or property value format.

  • 指定查询目标。Specify the destination of the query. 目标可以是变量或文件。The destination can be a variable or a file.

  • 指示覆盖、保留还是追加查询目标。Indicate whether the query destination is overwritten, kept, or appended.

如果源或目标是文件,则 WMI 数据读取器任务使用文件连接管理器连接到该文件。If the source or destination is a file, the WMI Data Reader task uses a File connection manager to connect to the file. 有关详细信息,请参阅 Flat File Connection ManagerFor more information, see Flat File Connection Manager.

WMI 数据读取器任务使用 WMI 连接管理器连接到该任务从中读取 WMI 信息的服务器。The WMI Data Reader task uses a WMI connection manager to connect to the server from which it reads WMI information. 有关详细信息,请参阅 WMI Connection ManagerFor more information, see WMI Connection Manager.

WQL 查询WQL Query

WQL 是 SQL 的方言,其扩展插件支持 WMI 事件通知和其他 WMI 特定功能。WQL is a dialect of SQL with extensions to support WMI event notification and other WMI-specific features. 有关 WQL 的详细信息,请参阅 MSDN Library中的 Windows Management Instrumentation 文档。For more information about WQL, see the Windows Management Instrumentation documentation in the MSDN Library.

备注

WMI 类因 Windows 版本的不同而异。WMI classes vary between versions of Windows.

下列 WQL 查询返回应用程序日志事件中的项。The following WQL query returns entries in the Application log event.

SELECT * FROM Win32_NTLogEvent WHERE LogFile = 'Application' AND (SourceName='SQLISService' OR SourceName='SQLISPackage') AND TimeGenerated > '20050117'  

下列 WQL 查询返回逻辑磁盘信息。The following WQL query returns logical disk information.

SELECT FreeSpace, DeviceId, Size, SystemName, Description FROM Win32_LlogicalDisk  

下列 WQL 查询返回操作系统的快速修补工程 (QFE) 更新列表。The following WQL query returns a list of the quick fix engineering (QFE) updates to the operating system.

Select * FROM Win32_QuickFixEngineering  

WMI 数据读取器任务可用的自定义日志记录消息Custom Logging Messages Available on the WMI Data Reader Task

下表列出了 WMI 数据读取器任务的自定义日志项。The following table lists the custom log entries for the WMI Data Reader task. 有关详细信息,请参阅 Integration Services (SSIS) 日志记录For more information, see Integration Services (SSIS) Logging.

日志项Log entry 说明Description
WMIDataReaderGettingWMIDataWMIDataReaderGettingWMIData 指示任务已开始读取 WMI 数据。Indicates that the task began to read WMI data.
WMIDataReaderOperationWMIDataReaderOperation 报告任务所运行的 WQL 查询。Reports the WQL query that the task ran.

配置 WMI 数据读取器任务Configuration of the WMI Data Reader Task

可以采用编程方式或通过 SSISSSIS 设计器来设置属性。You can set properties programmatically or through SSISSSIS Designer.

有关可在 SSISSSIS 设计器中设置的属性的信息,请单击以下主题:For information about the properties that you can set in SSISSSIS Designer, click the following topic:

有关以编程方式设置这些属性的信息,请单击以下主题:For information about programmatically setting these properties, click the following topic:

有关如何在 SSISSSIS 设计器中设置这些属性的详细信息,请单击下列主题:For more information about how to set these properties in SSISSSIS Designer, click the following topic:

WMI 数据读取器任务编辑器(“常规”页)WMI Data Reader Task Editor (General Page)

可以使用 “WMI 数据读取器任务编辑器” 对话框的 “常规” 页,对 WMI 数据读取器任务进行命名和说明。Use the General page of the WMI Data Reader Task Editor dialog box to name and describe the WMI Data Reader task.

有关 WMI 查询语言 (WQL) 的详细信息,请参阅 MSDN 库中的 Windows Management Instrumentation 主题 Querying with WQL(利用 WQL 进行查询)。For more information about WMI Query Language (WQL), see the Windows Management Instrumentation topic, Querying with WQL, in the MSDN Library.

选项Options

名称Name
为 WMI 数据读取器任务提供唯一的名称。Provide a unique name for the WMI Data Reader task. 此名称用作任务图标中的标签。This name is used as the label in the task icon.

备注

任务名称在一个包内必须是唯一的。Task names must be unique within a package.

说明Description
键入对 WMI 数据读取器任务的说明。Type a description of the WMI Data Reader task.

WMI 数据读取器任务编辑器(“WMI 选项”页)WMI Data Reader Task Editor (WMI Options Page)

可以使用“WMI 数据读取器任务编辑器” 对话框的“WMI 选项” 页,指定 Windows Management Instrumentation 查询语言 (WQL) 查询的源和查询结果的目标。Use the WMI Options page of the WMI Data Reader Task Editor dialog box to specify the source of the Windows Management Instrumentation Query Language (WQL) query and the destination of the query result.

有关 WMI 查询语言 (WQL) 的详细信息,请参阅 MSDN 库中的 Windows Management Instrumentation 主题 Querying with WQL(利用 WQL 进行查询)。For more information about WMI Query Language (WQL), see the Windows Management Instrumentation topic, Querying with WQL, in the MSDN Library.

静态选项Static Options

WMIConnectionNameWMIConnectionName
从列表中选择 WMI 连接管理器,或单击 <New WMI Connection...> 创建新的连接管理器。Select a WMI connection manager in the list, or click <New WMI Connection...> to create a new connection manager.

相关主题: WMI 连接管理器WMI 连接管理器编辑器Related Topics: WMI Connection Manager, WMI Connection Manager Editor

WQLQuerySourceTypeWQLQuerySourceType
选择任务运行的 WQL 查询的源类型。Select the source type of the WQL query that the task runs. 此属性具有下表所列的选项。This property has the options listed in the following table.

Value 说明Description
直接输入Direct input 为 WQL 查询设置源。Set the source to a WQL query. 选择此值将显示动态选项 WQLQuerySourceTypeSelecting this value displays the dynamic option WQLQuerySourceType.
文件连接File connection 选择包含 WQL 查询的文件。Select a file that contains the WQL query. 选择此值将显示动态选项 WQLQuerySourceTypeSelecting this value displays the dynamic option WQLQuerySourceType.
变量Variable 将源设置为定义 WQL 查询的变量。Set the source to a variable that defines the WQL query. 选择此值将显示动态选项 WQLQuerySourceTypeSelecting this value displays the dynamic option WQLQuerySourceType.

OutputTypeOutputType
指定输出是数据表、属性值还是属性名称和值。Specify whether the output should be a data table, property value, or property name and value.

OverwriteDestinationOverwriteDestination
指定是保留、覆盖还是追加到目标文件或变量中的原始数据。Specifies whether to keep, overwrite, or append to the original data in the destination file or variable.

目标类型DestinationType
选择任务运行的 WQL 查询的目标类型。Select the destination type of the WQL query that the task runs. 此属性具有下表所列的选项。This property has the options listed in the following table.

Value 说明Description
文件连接File connection 选择用于保存 WQL 查询结果的文件。Select a file to save the results of the WQL query in. 选择此值将显示动态选项 DestinationTypeSelecting this value displays the dynamic option, DestinationType.
变量Variable 设置用于存储 WQL 查询结果的变量。Set the variable to store the results of the WQL query in. 选择此值将显示动态选项 DestinationTypeSelecting this value displays the dynamic option, DestinationType.

WQLQuerySourceType 动态选项WQLQuerySourceType Dynamic Options

WQLQuerySourceType = 直接输入WQLQuerySourceType = Direct input

WQLQuerySourceWQLQuerySource
提供查询,或单击省略号 (…),然后使用“WQL 查询”对话框输入查询 。Provide a query, or click the ellipsis (...) and enter a query using the WQL Query dialog box.

WQLQuerySourceType = 文件连接WQLQuerySourceType = File connection

WQLQuerySourceWQLQuerySource
从列表中选择文件连接管理器,或单击“<New connection...>”创建新的连接管理器。Select a File connection manager in the list, or click <New connection...> to create a new connection manager.

相关主题: 文件连接管理器文件连接管理器编辑器Related Topics: File Connection Manager, File Connection Manager Editor

WQLQuerySourceType = 变量WQLQuerySourceType = Variable

WQLQuerySourceWQLQuerySource
在列表中选择变量,或单击“<New variable...>创建一个新变量。Select a variable in the list, or click <New variable...> to create a new variable.

相关主题: Integration Services (SSIS) 变量添加变量Related Topics: Integration Services (SSIS) Variables, Add Variable

DestinationType 动态选项DestinationType Dynamic Options

DestinationType = 文件连接DestinationType = File connection

目标Destination
从列表中选择文件连接管理器,或单击 <New connection...> 创建新的连接管理器。Select a File connection manager in the list, or click <New connection...> to create a new connection manager.

相关主题: 文件连接管理器文件连接管理器编辑器Related Topics: File Connection Manager, File Connection Manager Editor

DestinationType = 变量DestinationType = Variable

目标Destination
在列表中选择变量,或单击 <New variable...> 创建新变量。Select a variable in the list, or click <New variable...> to create a new variable.

相关主题: Integration Services (SSIS) 变量添加变量Related Topics: Integration Services (SSIS) Variables, Add Variable

另请参阅See Also

Integration Services 任务 Integration Services Tasks
控制流Control Flow