Remove-SCAdvisorAgent

Remove-SCAdvisorAgent

Removes one or more agents from the group of agents that report to the Advisor Connector.

構文

Parameter Set: Default
Remove-SCAdvisorAgent [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-InputObjects <PartialMonitoringObject[]> ] [-PipelineVariable <String> ] [-SCSession <Connection[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

詳細説明

The Remove-SCAdvisorAgent cmdlet removes one or more agents from the group of agents that report to the System Center Advisor Connector.

パラメーター

-ComputerName<String[]>

Specifies an array of names of computers to establish connections with. The computer that you connect to must run the System Center Data Access service. The default is the computer for the current management group connection. Valid formats include a NetBIOS name, an IP address, and a fully qualified domain name. To specify the local computer, type the computer name, localhost, or a dot (.).

エイリアス

なし

必須?

false

位置は?

named

既定値

localhost

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

false

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

false

-Credential<PSCredential>

Specifies a PSCredential object under which the management group connection runs. To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.

You can specify a user name in one of the following formats: User01, Domain01\User01, or User@Domain.com. The default is the current user. The cmdlet prompts you for a password.

エイリアス

なし

必須?

false

位置は?

named

既定値

none

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

false

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

false

-InputObjects<PartialMonitoringObject[]>

Specifies an array of computer names to opt out from the Advisor Connector.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

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

True (ByValue)

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

false

-PipelineVariable<String>

Specifies a variable to use with the pipeline operator.

エイリアス

pv

必須?

false

位置は?

named

既定値

なし

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

false

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

false

-SCSession<Connection[]>

Specifies an array of connections to a management server. The default is the current management group connection. To obtain a management group connection object, use the Get-SCOMManagementGroupConnection cmdlet.

エイリアス

なし

必須?

false

位置は?

named

既定値

the current management group connection

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

false

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

false

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

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

false

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

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

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

false

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

false

<CommonParameters>

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

入力

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

出力

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

Example 1: Remove agents by name from a group of computers

The first command uses the Get-SCOMClass cmdlet to get all the Windows-based computers, passes those computers to the Get-SCOMClassInstance cmdlet by using the pipeline operator, and then uses the Where-Object cmdlet to find computers that contain the name ContosoAgent. The command stores these instances in the $WindowsComputers variable. For more information, type Get-Help Where-Object.

The second command removes all the agents that are stored in $WindowsComputers from the group of agents that report to the Advisor Connector.

PS C:\> $WindowsComputers = Get-SCOMClass -Name "Microsoft.Windows.computer" | Get-SCOMClassInstance | Where {$_.Name.Contains("ContosoAgent")}
PS C:\> Remove-SCAdvisorAgent -InputObjects $WindowsComputers

Example 2: Remove agents by name from a computer

The first command uses Get-SCOMClass to get all the Windows-based computers, passes those computers to Get-SCOMClassInstance by using the pipeline operator to find Computer062, and then uses Where-Object to find agents that contain the name ContosoAgent. The command stores these instances in the $WindowsComputers variable.

The second command removes all the Windows-based computers that are stored in $WindowsComputers from the group of agents that report to the Advisor Connector.

PS C:\> $WindowsComputers = Get-SCOMClass -Name "Microsoft.Windows.computer" | Get-SCOMClassInstance -ComputerName "Computer062" | Where {$_.Name.Contains("ContosoAgent")}
PS C:\> Remove-SCAdvisorAgent -InputObjects $WindowsComputers -ComputerName "Computer062"

関連トピック

Add-SCAdvisorAgent

Get-SCAdvisorAgent

Get-SCOMClass

Get-SCOMClassInstance

Get-SCOMManagementGroupConnection