Get-CMDataCollectionTasks

Get-CMDataCollectionTasks

Gets the data collection tasks that apply to a Configuration Manager client computer.

構文

Parameter Set: Default
Get-CMDataCollectionTasks [-MatchName <String[]> ] [-PipelineVariable <String> ] [ <CommonParameters>]

詳細説明

The Get-CMDataCollectionTasks cmdlet gets the data collection tasks that apply to a System Center 2012 Configuration Manager client computer.

パラメーター

-MatchName<String[]>

Specifies an array of strings to match. The cmdlet gets data collection tasks that have names that include one or more strings in the array. For example, if you specify the string "client" for this parameter, the cmdlet gets each data collection task that contains the string "client" in its task name.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-PipelineVariable<String>

Specifies a variable to use with the pipeline operator.

エイリアス

pv

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

Example 1: Get data collection tasks

This example establishes a remote connection to a Configuration Manager client, gets data collection tasks, and starts data collection.

The first command uses the ConvertTo-SecureString cmdlet to create a secure string based on the specified password, and then stores that string in the $Password variable. For more information, type Get-Help ConvertTo-SecureString.

The second command uses the New-CMMachineConnection cmdlet to create a connection to a remote computer by using the specified user name and the password stored in the $Password variable. The command verifies that it creates the connection.

The third command uses the current cmdlet to get data collection tasks, and stores them in the $Tasks variable.

The final command uses the Invoke-CMDataCollection cmdlet to start data collection of the tasks stored in $Tasks. The command specifies an output file.

PS C:\> $Password = ConvertTo-SecureString -AsPlainText -String "Password123" -Force
PS C:\> $Connection = New-CMMachineConnection -MachineName "Client01.corp.contoso.com" -UserName "CONTOSO\PattiFuller" -Password $Password -Verify
PS C:\> $Tasks = Get-CMDataCollectionTasks
PS C:\> Invoke-CMDataCollection -MachineConnection $Connection -CollectionTasks $Tasks -OutputFile "C:\DataCollection\Client01Data"

関連トピック

Invoke-CMDataCollection

New-CMMachineConnection