New-CMMachineConnection

New-CMMachineConnection

Creates a connection to a Configuration Manager client computer.

構文

Parameter Set: Local
New-CMMachineConnection [-PipelineVariable <String> ] [-Verify] [ <CommonParameters>]

Parameter Set: Remote
New-CMMachineConnection -MachineName <String> [-Password <SecureString> ] [-PipelineVariable <String> ] [-UserName <String> ] [-Verify] [ <CommonParameters>]

詳細説明

The New-CMMachineConnection cmdlet creates a connection to a System Center 2012 Configuration Manager client computer. This connection allows you to gather a bundle of logs and other data from the client to provide to a support specialist.

You can connect to either a remote computer or the local computer. To connect to the local computer, do not specify the MachineName, Password, and UserName parameters. The cmdlet uses the credentials of the account that runs the cmdlet to connect to a local client computer.

パラメーター

-MachineName<String>

Specifies the name of the remote Configuration Manager client computer to connect to.

エイリアス

none

必須?

true

位置は?

named

既定値

none

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

false

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

false

-Password<SecureString>

Specifies the password for the user account to use to establish a remote connection.

エイリアス

none

必須?

false

位置は?

named

既定値

none

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

false

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

false

-PipelineVariable<String>

Specifies a variable to use with the pipeline operator.

エイリアス

pv

必須?

false

位置は?

named

既定値

none

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

false

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

false

-UserName<String>

Specifies the user name for the user account to use to establish a remote connection.

エイリアス

none

必須?

false

位置は?

named

既定値

none

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

false

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

false

-Verify

Indicates that the cmdlet verifies that it created a connection.

エイリアス

none

必須?

false

位置は?

named

既定値

none

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

false

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

false

<CommonParameters>

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

入力

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

出力

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

Example 1: Create a connection for data collection

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 current 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 Get-CMDataCollectionTasks 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"

関連トピック

Get-CMDataCollectionTasks

Invoke-CMDataCollection