Set-SCSMConnector
Set-SCSMConnector
Sets the enabled or disabled state on a connector.
Syntax
Parameter Set: Name
Set-SCSMConnector [-Name] <String[]> -State <SetSCSMConnectorCommand.StateEnum> [-ComputerName <String> ] [-Credential <PSCredential> ] [-PassThru] [ <CommonParameters>]
Parameter Set: Connector
Set-SCSMConnector [-ConnectorObject] <PSObject[]> -State <SetSCSMConnectorCommand.StateEnum> [-ComputerName <String> ] [-Credential <PSCredential> ] [-PassThru] [ <CommonParameters>]
Detailed Description
This cmdlet enables or disables connectors.
If the Name parameter is specified, all the connectors whose Name or DisplayName property matches the specified regular expression are set to the state specified in the State parameter. If connector objects are passed via the ConnectorObject parameter, the state of these connectors is set to the state specified in the State parameter. Either the Name parameter or the ConnectorObject parameter (but not both) must be specified.
The State parameter assumes one of two values: "Enabled" or "Disabled".
Parameters
-ComputerName<String>
Specifies the name of the computer on which the Service Manager SDK Service is running. The default value is "localhost". The user account that is defined in the Credential parameter must have access rights to the specified computer.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
localhost |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ConnectorObject<PSObject[]>
Specifies the connector object or objects on which state will be set.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-Credential<PSCredential>
Specifies the credentials to use when you connect to the server on which the Service Manager SDK Service is running. The provided user account must have access to that server. The default value for this parameter is the user account of the current context.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Name<String[]>
Specifies the name of the connector or connectors on which to set the enabled or disabled state.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-PassThru
Passes the updated connector objects to the pipeline. By default, this cmdlet does not produce any output.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-State<SetSCSMConnectorCommand.StateEnum>
Specifies the state to set for the connector. The value can either be "Enabled" or "Disabled".
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
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
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
System.Automation.Management.PSCustomObject
An object that represents a Service Manager connector.
Outputs
The output type is the type of the objects that the cmdlet emits.
System.Automation.Management.PSCustomObject
An object that represents a Service Manager connector. An object is returned only if the PassThru parameter is used.
Examples
-------------------------- EXAMPLE 1 --------------------------
Description
-----------
This command sets the state of all connectors with a name that starts with "AD" to "Disabled".
C:\PS>Get-SCSMConnector ^AD.* | Set-SCSMConnector -State Disabled
-------------------------- EXAMPLE 2 --------------------------
Description
-----------
This command attempts to set connector state on a connector that cannot be found.
C:\PS>Set-SCSMConnector AD -State Disabled
Set-SCSMConnector : Cannot find Connector 'AD' because it does not exist.
At line:1 char:14
+ Set-SCSMConnector <<<< AD
Related topics
Getting Started with Service Manager Cmdlets for Windows PowerShell