Update-SCSMConnector
Update-SCSMConnector
Updates the properties of a Service Manager connector.
Syntax
Parameter Set: Default
Update-SCSMConnector [-Connector] <Connector[]> [-PassThru] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Update-SCSMConnector cmdlet updates the properties of a connector. For example, you can set the Enabled property to ‘False’ to disable the connector, or you can set it to ‘True’ to enable the connector. This cmdlet is used in conjunction with the Get-SCSMConnector. After Get-SCSmConnector retrieves the object, the properties of the object can be set and then passed to the Update-SCSMConnector, which will update the properties.
For each connector type, you can update only the properties listed below:
Active Directory Connector:
Description
Enabled
Name
RunAsAccount
SelectedObjects
Configuration Manager Connector:
Collections
Description
Enabled
Name
RunAsAccount
Schedule
Operations Manager Alert Connector:
CloseAlert
Description
Enabled
Name
ResolveIncident
Rules
RunAsAccount
Schedule
Template
Operations Manager CI Connector:
Description
Enabled
Name
OperationsManagerServer
RunAsAccount
Schedule
Parameters
-Connector<Connector[]>
Specifies an object that represents a Service Manager connector.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-PassThru
Specifies the output object that represents the connector to update. This output object can be passed to other cmdlets.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Microsoft.EnterpriseManagement.ServiceManager.Sdk.Connectors.Connector
You can pipe a connector to the Connector parameter of the Update-SCSMConnector cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
None.
This cmdlet does not generate any output.
Examples
-------------------------- EXAMPLE 1 --------------------------
The commands in this example update the selected objects of an Active Directory connector.
PS C:\>$RA = get-scsmRunAsAccount -DisplayName "NewProfile"
PS C:\>$ADConnector = Get-SCSMConnector –DisplayName "WOODGROVE Active Directory"
To Update LDAP Query for computers
PS C:\>$ADConnector.SelectedComputers = "(&(objectCategory=computer)(name=*SM*))"
PS C:\>Get-SCSMConnector | %{ $_.RunAsAccount = $RA } | Update-SCSMConnector
-------------------------- EXAMPLE 2 --------------------------
The commands in this example update all connectors with a new RunAsAccount profile name.
PS C:\>$RA = Get-SCSMRunAsAccount -DisplayName "NewProfile"
PS C:\>Get-SCSMConnector | %{ $_.RunAsAccount = $RA } | Update-SCSMConnector
-------------------------- EXAMPLE 3 --------------------------
The commands in this example add a new rule to an Operations Manager Alert Connector.
PS C:\>$alertConnector = Get-SCSMConnector –DisplayName "Alert Connector"
PS C:\>$alertConnector.rules += new-SCSMAlertRule @{
>> Name = "newRule"
>> Template = get-SCSMObjectTemplate -name .*IncidentTemplate.*
>> ManagementPack = Get-SCManagementPack "System.Library"
>>}
PS C:\>Update-SCSMConnector $alertConnector