Update-SCSMConnector
Update-SCSMConnector
Updates the properties of a Service Manager connector.
構文
Parameter Set: Default
Update-SCSMConnector [-Connector] <Connector[]> [-PassThru] [-Confirm] [-WhatIf] [ <CommonParameters>]
詳細説明
The Update-SCSMConnector cmdlet updates the properties of a Service Manager connector. For example, you can set the Enable property to $False to disable the connector, or you can set it to $True to enable the connector. Use this cmdlet conjunction with the Get-SCSMConnector cmdlet. After Get-SCSmConnector retrieves the object, the properties of the object can be set and then passed to this cmdlet, which updates the properties.
The schedule property is only available if you have applied Service Manager 2012 R2 Update Rollup 6 or later.
For each connector type, you can update the following properties:
Active Directory Connector
-- Description
-- Enable
-- Name
-- RunAsAccount
-- SelectedObjects
-- Schedule
Configuration Manager Connector
-- Collections
-- Description
-- Enable
-- Name
-- RunAsAccount
-- Schedule
Operations Manager Alert Connector
-- CloseAlert
-- Description
-- Enable
-- Name
-- ResolveIncident
-- Rules
-- RunAsAccount
-- Schedule
-- Template
Operations Manager CI Connector
-- Description
-- Enable
-- Name
-- OperationsManagerServer
-- RunAsAccount
-- Schedule
パラメーター
-Connector<Connector[]>
Specifies an object that represents a Service Manager connector.
エイリアス |
なし |
必須? |
true |
位置は? |
1 |
既定値 |
なし |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
-PassThru
Specifies the output object that represents the connector to update. This output object can be passed to other cmdlets.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
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)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
Microsoft.EnterpriseManagement.ServiceManager.Sdk.Connectors.Connector
You can pipe a connector to the Connector parameter
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
None.
This cmdlet does not generate any output.
例
Example 1: Update objects in an Active Directory connector
This example updates the selected objects of an Active Directory connector. The first command gets a Run As account, by using the Get-SCSMRunAsAccount cmdlet, and then stores it in the $RunAsAccount variable.
The second command gets a connector by using the Get-SCSMConnector cmdlet, and then stores it in the $ADConnector variable.
The third command assigns a value to the Select property of $ADConnector.
The final command gets all connectors, and then passes those that use the $RunAsAccount as the Run As account to the current cmdlet. That cmdlet updates the connectors.
PS C:\> $RunAsAccount = Get-SCSMRunAsAccount -RunAsProfileName "NewProfile"
PS C:\> $ADConnector = Get-SCSMConnector -Name "WOODGROVE Active Directory"
PS C:\> $ADConnector.Select = "(&(objectCategory=computer)(name=*fulle*))"
PS C:\> Get-SCSMConnector | ForEach-Object { $_.RunAsAccount = $RunAsAccount } | Update-SCSMConnector
Example 2: Update the Run As account for connectors
The first command gets the Run As account that has the profile name NewProfile, and then stores the result in the $RunAsAccount variable.
The second command updates all connectors that have the Run As account of $RunAsAccount.
PS C:\> $RunAsAccount = Get-SCSMRunAsAccount -RunAsProfileName "NewProfile"
PS C:\> Get-SCSMConnector | ForEach-Object { $_.RunAsAccount = $RunAsAccount } | Update-SCSMConnector
Example 3: Update an Operations Manager Alert connector
This example adds a new rule to an Operations Manager Alert connector. The first command gets a connector, and then stores it in the $AlertConnector variable.
The second command adds a rule to the rules property of $AlertConnector. The New-SCSMAlertRule cmdlet creates the rule. The command extends over several lines.
The final command updates the connector to the current value of $AlertConnector.
PS C:\> $AlertConnector = Get-SCSMConnector "Alert Connector"
PS C:\>$AlertConnector.rules += New-SCSMAlertRule @{
>> Name = "newRule"
>> Template = Get-SCSMObjectTemplate -Name ".*IncidentTemplate.*"
>> ManagementPack = Get-SCManagementPack "System.Library"
>>}
PS C:\>Update-SCSMConnector -Connector $AlertConnector